xframelib 0.5.5 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import{h as ro,openBlock as H,createElementBlock as tt,normalizeStyle as yt,renderSlot as ft,reactive as bn,computed as pt,defineComponent as Tt,ref as nt,onMounted as Sn,onUpdated as so,nextTick as Cn,normalizeClass as ao,createElementVNode as V,createCommentVNode as zt,createVNode as xn,Transition as kn,withCtx as Wt,withModifiers as En,getCurrentInstance as co,watch as Ft,onBeforeUnmount as uo,resolveComponent as zn,createBlock as ct,withDirectives as lo,Fragment as wt,createTextVNode as Mn,toDisplayString as ho,vShow as fo,markRaw as _n,toRefs as po,renderList as Mt,resolveDynamicComponent as bt}from"vue";import{Client as mo,ClientContext as we}from"@hprose/rpc-core";import{ByteStream as Rn}from"@hprose/io";import{HttpTransport as go}from"@hprose/rpc-html5";import vo from"axios";var yo={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((i,r)=>(i.size=r===t?i.max:i.min,r!==t&&(n+=i.min),i)),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:i}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:i-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 i=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),c=Math.max(Math.min(this.getCurrentDragPercentage(e),r),i);let v=[t,t+1],y=this.panes[v[0]]||null,w=this.panes[v[1]]||null;const S=y.max<100&&c>=y.max+n.prevPanesSize,k=w.max<100&&c<=100-(w.max+this.sumNextPanesSize(t+1));if(S||k)S?(y.size=y.max,w.size=Math.max(100-y.max-n.prevPanesSize-n.nextPanesSize,0)):(y.size=Math.max(100-w.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),w.size=w.max);else{if(this.pushOtherPanes){const z=this.doPushOtherPanes(n,c);if(!z)return;({sums:n,panesToResize:v}=z),y=this.panes[v[0]]||null,w=this.panes[v[1]]||null}y!==null&&(y.size=Math.min(Math.max(c-n.prevPanesSize-n.prevReachedMinPanes,y.min),y.max)),w!==null&&(w.size=Math.min(Math.max(100-c-n.nextPanesSize-n.nextReachedMinPanes,w.min),w.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,i=[n,n+1];return t<e.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((r,c)=>{c>i[0]&&c<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,c)=>{c>0&&c<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[i[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((r,c)=>{c>n&&c<i[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,c)=>{c<this.panesCount-1&&c>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[i[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:i}},sumPrevPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i>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 i=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=c=>this.onMouseDown(c,i),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=c=>this.onMouseDown(c,i)),r.onclick=c=>this.onSplitterClick(c,i+1)),this.dblClickSplitter&&(r.ondblclick=c=>this.onSplitterDblClick(c,i+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(([i,r])=>n[i]=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),i=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,c)=>r.index=c),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(i=>i.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((i,r)=>i.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.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=[],i=[];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&&i.push(r.id)}),t>.1&&this.readjustSizes(t,n,i)},initialPanesSizing(){let e=100;const t=[],n=[];let i=0;this.panes.forEach(c=>{e-=c.size,c.size!==null&&i++,c.size>=c.max&&t.push(c.id),c.size<=c.min&&n.push(c.id)});let r=100;e>.1&&(this.panes.forEach(c=>{c.size===null&&(c.size=Math.max(Math.min(e/(this.panesCount-i),c.max),c.min)),r-=c.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const i=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(c=>{n-=c.size,c.size>=c.max&&i.push(c.id),c.size<=c.min&&r.push(c.id)}),Math.abs(n)<.1||(this.panes.forEach(c=>{e&&e.givenSize!==null&&e.id===c.id||(c.size=Math.max(Math.min(t,c.max),c.min)),n-=c.size,c.size>=c.max&&i.push(c.id),c.size<=c.min&&r.push(c.id)}),n>.1&&this.readjustSizes(n,i,r))},readjustSizes(e,t,n){let i;i=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const c=Math.max(Math.min(r.size+i,r.max),r.min);e-=c-r.size,r.size=c}else if(!n.includes(r.id)){const c=Math.max(Math.min(r.size+i,r.max),r.min);e-=c-r.size,r.size=c}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?i=>this.onSplitterDblClick(i,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 ro("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},be={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})}}};be.render=function(e,t,n,i,r,c){return H(),tt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=v=>c.onPaneClick(v,e._.uid)),style:yt(e.style)},[ft(e.$slots,"default")],4)},be.__file="src/controls/splitpanes/pane.vue";var _t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(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 wo={exports:{}},In=wo.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(b,u){var d=b[0],h=b[1],l=b[2],p=b[3];h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[0]-680876936|0)<<7|d>>>25)+h|0)&h|~d&l)+u[1]-389564586|0)<<12|p>>>20)+d|0)&d|~p&h)+u[2]+606105819|0)<<17|l>>>15)+p|0)&p|~l&d)+u[3]-1044525330|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[4]-176418897|0)<<7|d>>>25)+h|0)&h|~d&l)+u[5]+1200080426|0)<<12|p>>>20)+d|0)&d|~p&h)+u[6]-1473231341|0)<<17|l>>>15)+p|0)&p|~l&d)+u[7]-45705983|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[8]+1770035416|0)<<7|d>>>25)+h|0)&h|~d&l)+u[9]-1958414417|0)<<12|p>>>20)+d|0)&d|~p&h)+u[10]-42063|0)<<17|l>>>15)+p|0)&p|~l&d)+u[11]-1990404162|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[12]+1804603682|0)<<7|d>>>25)+h|0)&h|~d&l)+u[13]-40341101|0)<<12|p>>>20)+d|0)&d|~p&h)+u[14]-1502002290|0)<<17|l>>>15)+p|0)&p|~l&d)+u[15]+1236535329|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[1]-165796510|0)<<5|d>>>27)+h|0)&l|h&~l)+u[6]-1069501632|0)<<9|p>>>23)+d|0)&h|d&~h)+u[11]+643717713|0)<<14|l>>>18)+p|0)&d|p&~d)+u[0]-373897302|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[5]-701558691|0)<<5|d>>>27)+h|0)&l|h&~l)+u[10]+38016083|0)<<9|p>>>23)+d|0)&h|d&~h)+u[15]-660478335|0)<<14|l>>>18)+p|0)&d|p&~d)+u[4]-405537848|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[9]+568446438|0)<<5|d>>>27)+h|0)&l|h&~l)+u[14]-1019803690|0)<<9|p>>>23)+d|0)&h|d&~h)+u[3]-187363961|0)<<14|l>>>18)+p|0)&d|p&~d)+u[8]+1163531501|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[13]-1444681467|0)<<5|d>>>27)+h|0)&l|h&~l)+u[2]-51403784|0)<<9|p>>>23)+d|0)&h|d&~h)+u[7]+1735328473|0)<<14|l>>>18)+p|0)&d|p&~d)+u[12]-1926607734|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[5]-378558|0)<<4|d>>>28)+h|0)^h^l)+u[8]-2022574463|0)<<11|p>>>21)+d|0)^d^h)+u[11]+1839030562|0)<<16|l>>>16)+p|0)^p^d)+u[14]-35309556|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[1]-1530992060|0)<<4|d>>>28)+h|0)^h^l)+u[4]+1272893353|0)<<11|p>>>21)+d|0)^d^h)+u[7]-155497632|0)<<16|l>>>16)+p|0)^p^d)+u[10]-1094730640|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[13]+681279174|0)<<4|d>>>28)+h|0)^h^l)+u[0]-358537222|0)<<11|p>>>21)+d|0)^d^h)+u[3]-722521979|0)<<16|l>>>16)+p|0)^p^d)+u[6]+76029189|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[9]-640364487|0)<<4|d>>>28)+h|0)^h^l)+u[12]-421815835|0)<<11|p>>>21)+d|0)^d^h)+u[15]+530742520|0)<<16|l>>>16)+p|0)^p^d)+u[2]-995338651|0)<<23|h>>>9)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[0]-198630844|0)<<6|d>>>26)+h|0)|~l))+u[7]+1126891415|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[14]-1416354905|0)<<15|l>>>17)+p|0)|~d))+u[5]-57434055|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[12]+1700485571|0)<<6|d>>>26)+h|0)|~l))+u[3]-1894986606|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[10]-1051523|0)<<15|l>>>17)+p|0)|~d))+u[1]-2054922799|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[8]+1873313359|0)<<6|d>>>26)+h|0)|~l))+u[15]-30611744|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[6]-1560198380|0)<<15|l>>>17)+p|0)|~d))+u[13]+1309151649|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[4]-145523070|0)<<6|d>>>26)+h|0)|~l))+u[11]-1120210379|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[2]+718787259|0)<<15|l>>>17)+p|0)|~d))+u[9]-343485551|0)<<21|h>>>11)+l|0,b[0]=d+b[0]|0,b[1]=h+b[1]|0,b[2]=l+b[2]|0,b[3]=p+b[3]|0}function i(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b.charCodeAt(u)+(b.charCodeAt(u+1)<<8)+(b.charCodeAt(u+2)<<16)+(b.charCodeAt(u+3)<<24);return d}function r(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b[u]+(b[u+1]<<8)+(b[u+2]<<16)+(b[u+3]<<24);return d}function c(b){var u,d,h,l,p,T,R=b.length,B=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=R;u+=64)n(B,i(b.substring(u-64,u)));for(d=(b=b.substring(u-64)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b.charCodeAt(u)<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(B,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*R).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),T=parseInt(l[1],16)||0,h[14]=p,h[15]=T,n(B,h),B}function v(b){var u,d,h,l,p,T,R=b.length,B=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=R;u+=64)n(B,r(b.subarray(u-64,u)));for(d=(b=u-64<R?b.subarray(u-64):new Uint8Array(0)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b[u]<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(B,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*R).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),T=parseInt(l[1],16)||0,h[14]=p,h[15]=T,n(B,h),B}function y(b){var u,d="";for(u=0;u<4;u+=1)d+=t[b>>8*u+4&15]+t[b>>8*u&15];return d}function w(b){var u;for(u=0;u<b.length;u+=1)b[u]=y(b[u]);return b.join("")}function S(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function k(b,u){var d,h=b.length,l=new ArrayBuffer(h),p=new Uint8Array(l);for(d=0;d<h;d+=1)p[d]=b.charCodeAt(d);return u?p:l}function z(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function I(b,u,d){var h=new Uint8Array(b.byteLength+u.byteLength);return h.set(new Uint8Array(b)),h.set(new Uint8Array(u),b.byteLength),d?h:h.buffer}function D(b){var u,d=[],h=b.length;for(u=0;u<h-1;u+=2)d.push(parseInt(b.substr(u,2),16));return String.fromCharCode.apply(String,d)}function P(){this.reset()}return w(c("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function b(u,d){return(u=0|u||0)<0?Math.max(u+d,0):Math.min(u,d)}ArrayBuffer.prototype.slice=function(u,d){var h,l,p,T,R=this.byteLength,B=b(u,R),U=R;return d!==e&&(U=b(d,R)),B>U?new ArrayBuffer(0):(h=U-B,l=new ArrayBuffer(h),p=new Uint8Array(l),T=new Uint8Array(this,B,h),p.set(T),l)}}(),P.prototype.append=function(b){return this.appendBinary(S(b)),this},P.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var u,d=this._buff.length;for(u=64;u<=d;u+=64)n(this._hash,i(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},P.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h.charCodeAt(u)<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=D(d)),this.reset(),d},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(b,u){var d,h,l,p=u;if(b[p>>2]|=128<<(p%4<<3),p>55)for(n(this._hash,b),p=0;p<16;p+=1)b[p]=0;d=(d=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(d[2],16),l=parseInt(d[1],16)||0,b[14]=h,b[15]=l,n(this._hash,b)},P.hash=function(b,u){return P.hashBinary(S(b),u)},P.hashBinary=function(b,u){var d=w(c(b));return u?D(d):d},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(b){var u,d=I(this._buff.buffer,b,!0),h=d.length;for(this._length+=b.byteLength,u=64;u<=h;u+=64)n(this._hash,r(d.subarray(u-64,u)));return this._buff=u-64<h?new Uint8Array(d.buffer.slice(u-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h[u]<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=D(d)),this.reset(),d},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var b=P.prototype.getState.call(this);return b.buff=z(b.buff),b},P.ArrayBuffer.prototype.setState=function(b){return b.buff=k(b.buff,!0),P.prototype.setState.call(this,b)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(b,u){var d=w(v(new Uint8Array(b)));return u?D(d):d},P}();const Ce=[];class lt{static addHandler(t,n,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent?t.attachEvent("on"+n,i):t["on"+n]=i}static windowResizeHandler(t){lt.addHandler(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 i=window.document;let r=window.document.exitFullscreen||i.msExitFullscreen||i.mozCancelFullScreen||i.webkitCancelFullScreen;if(r!==void 0&&r)r.call(window.document);else if(window.ActiveXObject!==void 0){let c=new window.ActiveXObject("WScript.Shell");c?.SendKeys("{F11}")}}else{let i=t;i||(i=window.document.documentElement);let r=i.requestFullScreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullScreen;if(r!==void 0&&r)r.call(i);else if(window.ActiveXObject!==void 0){let c=new window.ActiveXObject("WScript.Shell");c?.SendKeys("{F11}")}}}static requestFullScreen(t=window.document.documentElement){let n=t;var i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i)i.call(n);else if(window.ActiveXObject!==void 0){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(window.ActiveXObject!==void 0){var i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!lt.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 i=lt.isFullScreen();t(i)}):document.addEventListener("MSFullscreenChange",function(){const i=lt.isFullScreen();t(i)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Ce.indexOf(n)!==-1)return;Ce.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,lt.stringifyCircularHandler);return Ce.length=0,n}static jsonParse(t){const n=lt.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const i=window;return i.createObjcectURL!=null?n=i.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const i=File.prototype,r=i.slice||i.mozSlice||i.webkitSlice,c=t,v=new In.ArrayBuffer,y=new FileReader;y.onload=function(w){v.append(w.target?.result);const S=v.end();n({isOK:!0,data:S})},y.onerror=function(){const w="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(w),n({isOK:!1,data:w})},function(){const w=2097152>=c.size?c.size:2097152;y.readAsArrayBuffer(r.call(c,0,w))}()}static MD5(t,n=!1){return In.hash(t,n)}static copyText=t=>new Promise((n,i)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}class $t{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,i)=>i.toUpperCase()).replace("views","")}}class Ht{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,i=604800){const r=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const i=this.storage.getItem(this.getKey(t));if(i)try{const r=JSON.parse(i),{value:c,expire:v}=r;if(v===null||v>=Date.now())return c;this.remove(this.getKey(t))}catch{return n}return n}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,i=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${i}`}getCookie(t){const n=document.cookie.split("; ");for(let i=0,r=n.length;i<r;i++){const c=n[i].split("=");if(c[0]===this.getKey(t))return c[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 bo=new Ht("",localStorage);function qt(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]=t.substr(3&Number(e[19])|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function So(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function Co(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),i=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),c=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+c.toString(16)).slice(-2)}function xo(e){var t=e.toLowerCase();if(Gt(e)){if(t.length===4){for(var n="#",i=1;i<4;i+=1){const c=t.slice(i,i+1);n+=c.concat(c)}t=n}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+t.slice(i,i+2)));return"rgb("+r.join(",")+")"}return t}function ko(e){const t=e;if(t.length===4){let i="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);i+=r.concat(r)}return i}return t}var St,Rt;function Eo(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substr(0,1);return t==="#"?St.Hex:t==="r"||t==="("?St.RGBA:t==="h"?St.Hsla:St.RGBA}function zo(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,i,r,c=(parseFloat(t[1])%360+360)%360/360,v=parseFloat(t[2])/(/%$/.test(t[2])?100:1),y=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(v===0)n=i=r=y;else{var w=y<=.5?y*(v+1):y+v-y*v,S=2*y-w;n=xe(S,w,c+1/3),i=xe(S,w,c),r=xe(S,w,c-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function xe(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 Gt(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function Mo(e,t,n){const i=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function ke(e){let t=e.toLowerCase();if(Gt(e)){if(t.length===4){let i="#";for(let r=1;r<4;r+=1)i+=t.slice(r,r+1).concat(t.slice(r,r+1));t=i}const n=[];for(let i=1;i<7;i+=2)n.push(parseInt("0x"+t.slice(i,i+2)));return"RGB("+n.join(",")+")"}return t}function _o(e){if(!Gt(e))return;const[t,n,i]=ke(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*i<192}function Ro(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${ze(e.substring(0,2),t)}${ze(e.substring(2,4),t)}${ze(e.substring(4,6),t)}`}function Io(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Ee(e.substring(0,2),t)}${Ee(e.substring(2,4),t)}${Ee(e.substring(4,6),t)}`}function Ee(e,t){const n=parseInt(e,16)+t,i=n>255?255:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Ln(e,t,n){const i=[e,t,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Lo(e){const t=ke(e.substring(1));var n,i;return n=t.split(","),i=[0,0,0],(Ln(~~n[0],~~n[1],~~n[2])+.05)/(Ln(i[0],i[1],i[2])+.05)>=12?"#000000":"#FFFFFF"}function ze(e,t){const n=parseInt(e,16)-t,i=n<0?0:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Me(e){return{all:e=e||new Map,on(t,n){const i=e?.get(t);i&&i.push(n)||e?.set(t,[n])},off(t,n){const i=e?.get(t);i&&i.splice(i.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(i=>{i(n)}),(e?.get("*")||[]).slice().map(i=>{i(t,n)})}}}(Rt=St||(St={}))[Rt.RGBA=0]="RGBA",Rt[Rt.Hex=1]="Hex",Rt[Rt.Hsla=2]="Hsla";const It=Me(),K={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},Xt=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const i=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(i),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Po(e,t){const n=window.URL||window.webkitURL||window,i=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=t,r.click(),n.revokeObjectURL(r.href)}const Pn=(e,t)=>{const n=JSON.stringify(e,null,2);t?Xt(n,t+".json"):It.emit(K.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},To=(e,t,n)=>{e.get(t).then(function(i){Xt(i.data,n)}).catch(i=>{console.warn(i),It.emit(K.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Tn(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function Bo({url:e,target:t="_blank",fileName:n}){const i=new URL(e).host==location.host;return new Promise((r,c)=>{if(i){const v=document.createElement("a");if(v.href=e,v.target=t,v.download!==void 0&&(v.download=n||Tn(e)),document.createEvent){const y=document.createEvent("MouseEvents");return y.initEvent("click",!0,!0),v.dispatchEvent(y),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const v=document.createElement("canvas"),y=document.createElement("img");y.setAttribute("crossOrigin","Anonymous"),y.src=e,y.onload=w=>{v.width=y.width,v.height=y.height,v.getContext("2d").drawImage(y,0,0,y.width,y.height),v.toBlob(S=>{if(S){const k=document.createElement("a");k.href=window.URL.createObjectURL(S),k.download=Tn(e),k.click(),URL.revokeObjectURL(k.href),r(!0)}},"image/jpeg")},y.onerror=w=>c(w)}})}function Ao(e){for(var t=new Date().getTime();new Date().getTime()-t<e;);console.log(`\u5F3A\u5236\u7B49\u5F85${e}\u6BEB\u79D2`)}class Ut{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!$t.isNullOrEmpty(t)){if(Ut.httpTransport||(Ut.httpTransport=new go),this.client=new mo(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")):It.emit(K.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,i){if(this.client)return await this.client.invoke(t,n,i)}encode(t,n,i){return this.client?this.client.codec.encode(t,n,i):void 0}decode(t,n){return this.client?this.client.codec.decode(t,n):void 0}}const mt=new Ht("user",localStorage);function Ct(){return mt.get("access_token")}function _e(){mt.remove("access_token"),L.User&&delete L.User}function Bn(){return Ct()?.refresh}class Bt{hproseClient;hpProxyObj;defaultContext=new we;constructor(t){this.hproseClient=new Ut(t),this.hpProxyObj=null}getClientContext(t,n){const i={};n&&(i.requestHeaders=n);const r=Ct();i.httpRequestHeaders=t||{};const c=i.httpRequestHeaders;return r&&(c.token=r.token),new we(i)}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||It.emit(K.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,i){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,i)}async hproseInvokeContext(t,n,...i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Ct();return console.log(r,"userToken3"),r&&(n||(n=new we({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,i,n)}async hproseInvokeEncode(t){const n=new Rn(t).toBytes(),i=await this.hproseClient.client?.request(n,this.defaultContext);return i&&this.hproseClient.client?.codec.decode(i,this.defaultContext)}encodeRequest(t,...n){const i=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return Rn.toString(i)}}class Do{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,i="success"){if(this.message)if(typeof this.message=="function")this.message({type:i,message:t,duration:n});else switch(i){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn(t,n);break;case"error":this.message.error(t,n)}else{switch(i){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":i="dark",console.error(t)}this.eventBus&&this.eventBus.emit(K.AlertInfoEvent,{type:i,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")}}const Re=new Map,L={Config:SysConfig,EventBus:It,DefaultProxyClient:null,Axios:vo};function No(e){An(e.message,e.defaultHproseURL),e.config&&(L.Config=e.config)}const An=function(e,t){t?L.Config.DefaultHproseAPI=t:!L.Config.DefaultHproseAPI&&L.Config.ServiceURL&&(L.Config.DefaultHproseAPI=L.Config.ServiceURL.DefaultHproseAPI),L.Config.DefaultHproseAPI&&$t.isNotEmpty(L.Config.DefaultHproseAPI)&&(L.DefaultProxyClient=new Bt(L.Config.DefaultHproseAPI));const n=new Do(e,L.EventBus);L.Message=n,L.EventBus.on(K.HproseServiceErrorEvent,i=>{const r=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;n.warn(r)}),L.EventBus.on(K.WebAPIErrorEvent,i=>{const r=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;n.warn(r)}),L.EventBus.on(K.CommonWarnEvent,i=>{n.warn(i)})};function Dn(e){if(e&&$t.isNotEmpty(e)){if(Re.has(e))return Re.get(e);{const t=new Bt(e);return Re.set(e,t),t}}}function Uo(e){const t=Dn(e);return t&&(L.DefaultProxyClient=t),t}function Ie(e,t,n,i="json",r){const c={baseURL:L.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,headers:{"Content-Type":"application/json",Authorization:"bearer "+Ct()?.token},responseType:i,cancelToken:r};if(n)for(let v in n)c.headers[v]=n[v];return t&&(c.baseURL=t),c}function rt(e,t,n,i,r="json",c,v){const y=Ie(n,t,i,r,c);return v&&v>=2e4&&(y.timeout=v),L.Axios?.get(e,y).catch(function(w){Vt(w,t,e,"Get")})}function Vt(e,t,n,i="Get"){const r=`${t}${n}`;if(e&&e.response){let c=!1;const v=e.response.status;switch(v){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 w=e.response.data;if(w){const S=w.indexOf(":"),k=w.indexOf(`\r
2
- `);if(S>0&&k-S>2){const z=w.substring(S+2,k);z.indexOf("'System.Exception'")>0?e.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(c=!0,e.message=z)}}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 y={address:r,code:v,isExceptionInfo:c,message:e.message,result:e.response.data};if(console.warn(`HTTP ${i}\u8BF7\u6C42\u9519\u8BEF\uFF1A`,y),L.EventBus.emit(K.AxiosRequestErrorEvent,y),c)throw new Error(e.message)}}function Le(e,t,n,i,r,c="json",v){const y=Ie(i,t,r,c);v&&v>=2e4&&(y.timeout=v);const w=function(S){let k=new FormData;return S&&Object.keys(S).forEach(z=>{if(!S)return;let I=S[z];var D;I!=null&&k.append(z,(D=I)instanceof Blob?D:D.toString())}),k}(n);return L.Axios?.post(e,w,y).catch(function(S){Vt(S,t,e,"Post")})}function Oo(e,t,n,i,r,c="json",v){const y=Ie(i,t,r,c);return v&&v>=2e4&&(y.timeout=v),L.Axios?.post(e,n,y).catch(function(w){Vt(w,t,e,"Post")})}function jo(e,t){return rt(e,void 0,t)}function Wo(e,t){return Le(e,void 0,t)}function Fo(e,t){return L.Axios?.get(e,{params:t}).catch(function(n){Vt(n,e,"","\u5916\u90E8Get")})}var Pe={exports:{}},$o=typeof window<"u"?window:_t!==void 0?_t:typeof self<"u"?self:{},Ho=function(e){if(!e)return!1;var t=qo.call(e);return t==="[object Function]"||typeof e=="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},qo=Object.prototype.toString,Te=function(e){return e.replace(/^\s+|\s+$/g,"")},Go=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)Xo.call(n,i)&&(e[i]=n[i])}return e},Xo=Object.prototype.hasOwnProperty,Nn=$o,Vo=Ho,Ko=function(e){if(!e)return{};for(var t,n={},i=Te(e).split(`
3
- `),r=0;r<i.length;r++){var c=i[r],v=c.indexOf(":"),y=Te(c.slice(0,v)).toLowerCase(),w=Te(c.slice(v+1));n[y]===void 0?n[y]=w:(t=n[y],Object.prototype.toString.call(t)==="[object Array]"?n[y].push(w):n[y]=[n[y],w])}return n},Yo=Go;function Un(e,t,n){var i=e;return Vo(t)?(n=t,typeof e=="string"&&(i={uri:e})):i=Yo(t,{uri:e}),i.callback=n,i}function ut(e,t,n){return On(t=Un(e,t,n))}function On(e){if(e.callback===void 0)throw new Error("callback argument missing");var t=!1,n=function(d,h,l){t||(t=!0,e.callback(d,h,l))};function i(){var d=void 0;if(d=w.response?w.response:w.responseText||function(h){try{if(h.responseType==="document")return h.responseXML;var l=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!l)return h.responseXML}catch{}return null}(w),b)try{d=JSON.parse(d)}catch{}return d}function r(d){return clearTimeout(S),d instanceof Error||(d=new Error(""+(d||"Unknown XMLHttpRequest Error"))),d.statusCode=0,n(d,u)}function c(){if(!y){var d;clearTimeout(S),d=e.useXDR&&w.status===void 0?200:w.status===1223?204:w.status;var h=u,l=null;return d!==0?(h={body:i(),statusCode:d,method:z,headers:{},url:k,rawRequest:w},w.getAllResponseHeaders&&(h.headers=Ko(w.getAllResponseHeaders()))):l=new Error("Internal XMLHttpRequest Error"),n(l,h,h.body)}}var v,y,w=e.xhr||null;w||(w=e.cors||e.useXDR?new ut.XDomainRequest:new ut.XMLHttpRequest);var S,k=w.url=e.uri||e.url,z=w.method=e.method||"GET",I=e.body||e.data,D=w.headers=e.headers||{},P=!!e.sync,b=!1,u={body:void 0,headers:{},statusCode:0,method:z,url:k,rawRequest:w};if("json"in e&&e.json!==!1&&(b=!0,D.accept||D.Accept||(D.Accept="application/json"),z!=="GET"&&z!=="HEAD"&&(D["content-type"]||D["Content-Type"]||(D["Content-Type"]="application/json"),I=JSON.stringify(e.json===!0?I:e.json))),w.onreadystatechange=function(){w.readyState===4&&setTimeout(c,0)},w.onload=c,w.onerror=r,w.onprogress=function(){},w.onabort=function(){y=!0},w.ontimeout=r,w.open(z,k,!P,e.username,e.password),P||(w.withCredentials=!!e.withCredentials),!P&&e.timeout>0&&(S=setTimeout(function(){if(!y){y=!0,w.abort("timeout");var d=new Error("XMLHttpRequest timeout");d.code="ETIMEDOUT",r(d)}},e.timeout)),w.setRequestHeader)for(v in D)D.hasOwnProperty(v)&&w.setRequestHeader(v,D[v]);else if(e.headers&&!function(d){for(var h in d)if(d.hasOwnProperty(h))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(w.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(w),w.send(I||null),w}Pe.exports=ut,Pe.exports.default=ut,ut.XMLHttpRequest=Nn.XMLHttpRequest||function(){},ut.XDomainRequest="withCredentials"in new ut.XMLHttpRequest?ut.XMLHttpRequest:Nn.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){ut[e==="delete"?"del":e]=function(t,n,i){return(n=Un(t,n,i)).method=e.toUpperCase(),On(n)}});var Jo=Pe.exports;const Zo=[200,201,202,204,308],Qo=[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=Me(),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,i=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(i,i+n))})}xhrPromise(t){const n=i=>{i.upload.onprogress=r=>{const c=100/this.totalChunks,v=c*this.file.size,y=c*this.chunkCount,w=r.loaded/(r.total??v)*c;this.dispatch("progress",Math.min(y+w,100))}};return new Promise((i,r)=>{this.currentXhr=Jo({...t,beforeSend:n},(c,v)=>(this.currentXhr=void 0,c?r(c):i(v)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,i={...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:i,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(){this.paused||this.offline||this.success||this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Zo.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=100*(this.chunkCount/this.totalChunks*this.file.size)/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Qo.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;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 er=e=>new tr(e),nr=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)}},jn=mt.get("is_LockScreen",!1),At={isLock:jn,lockTime:jn=="true"?Fn():0};function Wn(e){At.isLock=e,mt.set("is_LockScreen",e,10),e&&(_e(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function ir(){return mt.get("is_LockScreen",!1)}function Fn(){let e=3600;return L.Config.UI?.LockTime&&L.Config.UI?.LockTime>=10&&(e=L.Config.UI.LockTime),e}let Be;function Ae(){clearInterval(Be),window.location.href.indexOf("/login")>0||At.isLock||(Wn(!1),At.lockTime=Fn(),Be=setInterval(()=>{if(At.lockTime--,At.lockTime<=0)return Wn(!0),clearInterval(Be)},1e3))}function or(){Ae(),document.addEventListener("mousedown",Ae)}function rr(){document.removeEventListener("mousedown",Ae)}var sr={exports:{}},Kt=sr.exports=function e(t,n,i){function r(y,w){if(!n[y]){if(!t[y]){if(!w&&Se)return Se(y);if(c)return c(y,!0);var S=new Error("Cannot find module '"+y+"'");throw S.code="MODULE_NOT_FOUND",S}var k=n[y]={exports:{}};t[y][0].call(k.exports,function(z){var I=t[y][1][z];return r(I||z)},k,k.exports,e,t,n,i)}return n[y].exports}for(var c=Se,v=0;v<i.length;v++)r(i[v]);return r}({1:[function(e,t,n){(function(i){var r,c,v=i.MutationObserver||i.WebKitMutationObserver;if(v){var y=0,w=new v(I),S=i.document.createTextNode("");w.observe(S,{characterData:!0}),r=function(){S.data=y=++y%2}}else if(i.setImmediate||i.MessageChannel===void 0)r="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var P=i.document.createElement("script");P.onreadystatechange=function(){I(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},i.document.documentElement.appendChild(P)}:function(){setTimeout(I,0)};else{var k=new i.MessageChannel;k.port1.onmessage=I,r=function(){k.port2.postMessage(0)}}var z=[];function I(){var P,b;c=!0;for(var u=z.length;u;){for(b=z,z=[],P=-1;++P<u;)b[P]();u=z.length}c=!1}function D(P){z.push(P)!==1||c||r()}t.exports=D}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var i=e(1);function r(){}var c={},v=["REJECTED"],y=["FULFILLED"],w=["PENDING"];function S(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=w,this.queue=[],this.outcome=void 0,l!==r&&D(this,l)}function k(l,p,T){this.promise=l,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}function z(l,p,T){i(function(){var R;try{R=p(T)}catch(B){return c.reject(l,B)}R===l?c.reject(l,new TypeError("Cannot resolve promise with itself")):c.resolve(l,R)})}function I(l){var p=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof p=="function")return function(){p.apply(l,arguments)}}function D(l,p){var T=!1;function R(j){T||(T=!0,c.reject(l,j))}function B(j){T||(T=!0,c.resolve(l,j))}function U(){p(B,R)}var O=P(U);O.status==="error"&&R(O.value)}function P(l,p){var T={};try{T.value=l(p),T.status="success"}catch(R){T.status="error",T.value=R}return T}function b(l){return l instanceof this?l:c.resolve(new this(r),l)}function u(l){var p=new this(r);return c.reject(p,l)}function d(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=l.length,R=!1;if(!T)return this.resolve([]);for(var B=new Array(T),U=0,O=-1,j=new this(r);++O<T;)$(l[O],O);return j;function $(G,X){function it(Q){B[X]=Q,++U!==T||R||(R=!0,c.resolve(j,B))}p.resolve(G).then(it,function(Q){R||(R=!0,c.reject(j,Q))})}}function h(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=l.length,R=!1;if(!T)return this.resolve([]);for(var B=-1,U=new this(r);++B<T;)O(l[B]);return U;function O(j){p.resolve(j).then(function($){R||(R=!0,c.resolve(U,$))},function($){R||(R=!0,c.reject(U,$))})}}t.exports=S,S.prototype.catch=function(l){return this.then(null,l)},S.prototype.then=function(l,p){if(typeof l!="function"&&this.state===y||typeof p!="function"&&this.state===v)return this;var T=new this.constructor(r);return this.state!==w?z(T,this.state===y?l:p,this.outcome):this.queue.push(new k(T,l,p)),T},k.prototype.callFulfilled=function(l){c.resolve(this.promise,l)},k.prototype.otherCallFulfilled=function(l){z(this.promise,this.onFulfilled,l)},k.prototype.callRejected=function(l){c.reject(this.promise,l)},k.prototype.otherCallRejected=function(l){z(this.promise,this.onRejected,l)},c.resolve=function(l,p){var T=P(I,p);if(T.status==="error")return c.reject(l,T.value);var R=T.value;if(R)D(l,R);else{l.state=y,l.outcome=p;for(var B=-1,U=l.queue.length;++B<U;)l.queue[B].callFulfilled(p)}return l},c.reject=function(l,p){l.state=v,l.outcome=p;for(var T=-1,R=l.queue.length;++T<R;)l.queue[T].callRejected(p);return l},S.resolve=b,S.reject=u,S.all=d,S.race=h},{1:1}],3:[function(e,t,n){(function(i){typeof i.Promise!="function"&&(i.Promise=e(2))}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function r(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}function c(){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 v=c();function y(){try{if(!v||!v.open)return!1;var o=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),s=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!o||s)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function w(o,s){o=o||[],s=s||{};try{return new Blob(o,s)}catch(f){if(f.name!=="TypeError")throw f;for(var a=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),m=0;m<o.length;m+=1)a.append(o[m]);return a.getBlob(s.type)}}typeof Promise>"u"&&e(3);var S=Promise;function k(o,s){s&&o.then(function(a){s(null,a)},function(a){s(a)})}function z(o,s,a){typeof s=="function"&&o.then(s),typeof a=="function"&&o.catch(a)}function I(o){return typeof o!="string"&&(console.warn(o+" used as a key, but it is not a string."),o=String(o)),o}function D(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",b=void 0,u={},d=Object.prototype.toString,h="readonly",l="readwrite";function p(o){for(var s=o.length,a=new ArrayBuffer(s),m=new Uint8Array(a),f=0;f<s;f++)m[f]=o.charCodeAt(f);return a}function T(o){return new S(function(s){var a=o.transaction(P,l),m=w([""]);a.objectStore(P).put(m,"key"),a.onabort=function(f){f.preventDefault(),f.stopPropagation(),s(!1)},a.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),g=navigator.userAgent.match(/Edge\//);s(g||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function R(o){return typeof b=="boolean"?S.resolve(b):T(o).then(function(s){return b=s})}function B(o){var s=u[o.name],a={};a.promise=new S(function(m,f){a.resolve=m,a.reject=f}),s.deferredOperations.push(a),s.dbReady?s.dbReady=s.dbReady.then(function(){return a.promise}):s.dbReady=a.promise}function U(o){var s=u[o.name].deferredOperations.pop();if(s)return s.resolve(),s.promise}function O(o,s){var a=u[o.name].deferredOperations.pop();if(a)return a.reject(s),a.promise}function j(o,s){return new S(function(a,m){if(u[o.name]=u[o.name]||Ze(),o.db){if(!s)return a(o.db);B(o),o.db.close()}var f=[o.name];s&&f.push(o.version);var g=v.open.apply(v,f);s&&(g.onupgradeneeded=function(C){var x=g.result;try{x.createObjectStore(o.storeName),C.oldVersion<=1&&x.createObjectStore(P)}catch(E){if(E.name!=="ConstraintError")throw E;console.warn('The database "'+o.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+o.storeName+'" already exists.')}}),g.onerror=function(C){C.preventDefault(),m(g.error)},g.onsuccess=function(){var C=g.result;C.onversionchange=function(x){x.target.close()},a(C),U(o)}})}function $(o){return j(o,!1)}function G(o){return j(o,!0)}function X(o,s){if(!o.db)return!0;var a=!o.db.objectStoreNames.contains(o.storeName),m=o.version<o.db.version,f=o.version>o.db.version;if(m&&(o.version!==s&&console.warn('The database "'+o.name+`" can't be downgraded from version `+o.db.version+" to version "+o.version+"."),o.version=o.db.version),f||a){if(a){var g=o.db.version+1;g>o.version&&(o.version=g)}return!0}return!1}function it(o){return new S(function(s,a){var m=new FileReader;m.onerror=a,m.onloadend=function(f){var g=btoa(f.target.result||"");s({__local_forage_encoded_blob:!0,data:g,type:o.type})},m.readAsBinaryString(o)})}function Q(o){return w([p(atob(o.data))],{type:o.type})}function st(o){return o&&o.__local_forage_encoded_blob}function le(o){var s=this,a=s._initReady().then(function(){var m=u[s._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return z(a,o,o),a}function he(o){B(o);for(var s=u[o.name],a=s.forages,m=0;m<a.length;m++){var f=a[m];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return o.db=null,$(o).then(function(g){return o.db=g,X(o)?G(o):g}).then(function(g){o.db=s.db=g;for(var C=0;C<a.length;C++)a[C]._dbInfo.db=g}).catch(function(g){throw O(o,g),g})}function at(o,s,a,m){m===void 0&&(m=1);try{var f=o.db.transaction(o.storeName,s);a(null,f)}catch(g){if(m>0&&(!o.db||g.name==="InvalidStateError"||g.name==="NotFoundError"))return S.resolve().then(function(){if(!o.db||g.name==="NotFoundError"&&!o.db.objectStoreNames.contains(o.storeName)&&o.version<=o.db.version)return o.db&&(o.version=o.db.version+1),G(o)}).then(function(){return he(o).then(function(){at(o,s,a,m-1)})}).catch(a);a(g)}}function Ze(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function li(o){var s=this,a={db:null};if(o)for(var m in o)a[m]=o[m];var f=u[a.name];f||(f=Ze(),u[a.name]=f),f.forages.push(s),s._initReady||(s._initReady=s.ready,s.ready=le);var g=[];function C(){return S.resolve()}for(var x=0;x<f.forages.length;x++){var E=f.forages[x];E!==s&&g.push(E._initReady().catch(C))}var M=f.forages.slice(0);return S.all(g).then(function(){return a.db=f.db,$(a)}).then(function(_){return a.db=_,X(a,s._defaultConfig.version)?G(a):_}).then(function(_){a.db=f.db=_,s._dbInfo=a;for(var A=0;A<M.length;A++){var N=M[A];N!==s&&(N._dbInfo.db=a.db,N._dbInfo.version=a.version)}})}function hi(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){at(a._dbInfo,h,function(C,x){if(C)return g(C);try{var E=x.objectStore(a._dbInfo.storeName).get(o);E.onsuccess=function(){var M=E.result;M===void 0&&(M=null),st(M)&&(M=Q(M)),f(M)},E.onerror=function(){g(E.error)}}catch(M){g(M)}})}).catch(g)});return k(m,s),m}function di(o,s){var a=this,m=new S(function(f,g){a.ready().then(function(){at(a._dbInfo,h,function(C,x){if(C)return g(C);try{var E=x.objectStore(a._dbInfo.storeName).openCursor(),M=1;E.onsuccess=function(){var _=E.result;if(_){var A=_.value;st(A)&&(A=Q(A));var N=o(A,_.key,M++);N!==void 0?f(N):_.continue()}else f()},E.onerror=function(){g(E.error)}}catch(_){g(_)}})}).catch(g)});return k(m,s),m}function fi(o,s,a){var m=this;o=I(o);var f=new S(function(g,C){var x;m.ready().then(function(){return x=m._dbInfo,d.call(s)==="[object Blob]"?R(x.db).then(function(E){return E?s:it(s)}):s}).then(function(E){at(m._dbInfo,l,function(M,_){if(M)return C(M);try{var A=_.objectStore(m._dbInfo.storeName);E===null&&(E=void 0);var N=A.put(E,o);_.oncomplete=function(){E===void 0&&(E=null),g(E)},_.onabort=_.onerror=function(){var W=N.error?N.error:N.transaction.error;C(W)}}catch(W){C(W)}})}).catch(C)});return k(f,a),f}function pi(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){at(a._dbInfo,l,function(C,x){if(C)return g(C);try{var E=x.objectStore(a._dbInfo.storeName).delete(o);x.oncomplete=function(){f()},x.onerror=function(){g(E.error)},x.onabort=function(){var M=E.error?E.error:E.transaction.error;g(M)}}catch(M){g(M)}})}).catch(g)});return k(m,s),m}function mi(o){var s=this,a=new S(function(m,f){s.ready().then(function(){at(s._dbInfo,l,function(g,C){if(g)return f(g);try{var x=C.objectStore(s._dbInfo.storeName).clear();C.oncomplete=function(){m()},C.onabort=C.onerror=function(){var E=x.error?x.error:x.transaction.error;f(E)}}catch(E){f(E)}})}).catch(f)});return k(a,o),a}function gi(o){var s=this,a=new S(function(m,f){s.ready().then(function(){at(s._dbInfo,h,function(g,C){if(g)return f(g);try{var x=C.objectStore(s._dbInfo.storeName).count();x.onsuccess=function(){m(x.result)},x.onerror=function(){f(x.error)}}catch(E){f(E)}})}).catch(f)});return k(a,o),a}function vi(o,s){var a=this,m=new S(function(f,g){o<0?f(null):a.ready().then(function(){at(a._dbInfo,h,function(C,x){if(C)return g(C);try{var E=x.objectStore(a._dbInfo.storeName),M=!1,_=E.openKeyCursor();_.onsuccess=function(){var A=_.result;A?o===0||M?f(A.key):(M=!0,A.advance(o)):f(null)},_.onerror=function(){g(_.error)}}catch(A){g(A)}})}).catch(g)});return k(m,s),m}function yi(o){var s=this,a=new S(function(m,f){s.ready().then(function(){at(s._dbInfo,h,function(g,C){if(g)return f(g);try{var x=C.objectStore(s._dbInfo.storeName).openKeyCursor(),E=[];x.onsuccess=function(){var M=x.result;M?(E.push(M.key),M.continue()):m(E)},x.onerror=function(){f(x.error)}}catch(M){f(M)}})}).catch(f)});return k(a,o),a}function wi(o,s){s=D.apply(this,arguments);var a=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var m,f=this;if(o.name){var g=o.name===a.name&&f._dbInfo.db?S.resolve(f._dbInfo.db):$(o).then(function(C){var x=u[o.name],E=x.forages;x.db=C;for(var M=0;M<E.length;M++)E[M]._dbInfo.db=C;return C});m=o.storeName?g.then(function(C){if(C.objectStoreNames.contains(o.storeName)){var x=C.version+1;B(o);var E=u[o.name],M=E.forages;C.close();for(var _=0;_<M.length;_++){var A=M[_];A._dbInfo.db=null,A._dbInfo.version=x}return new S(function(N,W){var F=v.open(o.name,x);F.onerror=function(ot){F.result.close(),W(ot)},F.onupgradeneeded=function(){F.result.deleteObjectStore(o.storeName)},F.onsuccess=function(){var ot=F.result;ot.close(),N(ot)}}).then(function(N){E.db=N;for(var W=0;W<M.length;W++){var F=M[W];F._dbInfo.db=N,U(F._dbInfo)}}).catch(function(N){throw(O(o,N)||S.resolve()).catch(function(){}),N})}}):g.then(function(C){B(o);var x=u[o.name],E=x.forages;C.close();for(var M=0;M<E.length;M++)E[M]._dbInfo.db=null;return new S(function(_,A){var N=v.deleteDatabase(o.name);N.onerror=function(){var W=N.result;W&&W.close(),A(N.error)},N.onblocked=function(){console.warn('dropInstance blocked for database "'+o.name+'" until all open connections are closed')},N.onsuccess=function(){var W=N.result;W&&W.close(),_(W)}}).then(function(_){x.db=_;for(var A=0;A<E.length;A++)U(E[A]._dbInfo)}).catch(function(_){throw(O(o,_)||S.resolve()).catch(function(){}),_})})}else m=S.reject("Invalid arguments");return k(m,s),m}var bi={_driver:"asyncStorage",_initStorage:li,_support:y(),iterate:di,getItem:hi,setItem:fi,removeItem:pi,clear:mi,length:gi,key:vi,keys:yi,dropInstance:wi};function Si(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci="~~local_forage_type~",Qe=/^~~local_forage_type~([^~]+)~/,Ot="__lfsc__:",de=Ot.length,fe="arbf",pe="blob",tn="si08",en="ui08",nn="uic8",on="si16",rn="si32",sn="ur16",an="ui32",cn="fl32",un="fl64",ln=de+fe.length,hn=Object.prototype.toString;function dn(o){var s,a,m,f,g,C=.75*o.length,x=o.length,E=0;o[o.length-1]==="="&&(C--,o[o.length-2]==="="&&C--);var M=new ArrayBuffer(C),_=new Uint8Array(M);for(s=0;s<x;s+=4)a=ht.indexOf(o[s]),m=ht.indexOf(o[s+1]),f=ht.indexOf(o[s+2]),g=ht.indexOf(o[s+3]),_[E++]=a<<2|m>>4,_[E++]=(15&m)<<4|f>>2,_[E++]=(3&f)<<6|63&g;return M}function me(o){var s,a=new Uint8Array(o),m="";for(s=0;s<a.length;s+=3)m+=ht[a[s]>>2],m+=ht[(3&a[s])<<4|a[s+1]>>4],m+=ht[(15&a[s+1])<<2|a[s+2]>>6],m+=ht[63&a[s+2]];return a.length%3==2?m=m.substring(0,m.length-1)+"=":a.length%3==1&&(m=m.substring(0,m.length-2)+"=="),m}function xi(o,s){var a="";if(o&&(a=hn.call(o)),o&&(a==="[object ArrayBuffer]"||o.buffer&&hn.call(o.buffer)==="[object ArrayBuffer]")){var m,f=Ot;o instanceof ArrayBuffer?(m=o,f+=fe):(m=o.buffer,a==="[object Int8Array]"?f+=tn:a==="[object Uint8Array]"?f+=en:a==="[object Uint8ClampedArray]"?f+=nn:a==="[object Int16Array]"?f+=on:a==="[object Uint16Array]"?f+=sn:a==="[object Int32Array]"?f+=rn:a==="[object Uint32Array]"?f+=an:a==="[object Float32Array]"?f+=cn:a==="[object Float64Array]"?f+=un:s(new Error("Failed to get type for BinaryArray"))),s(f+me(m))}else if(a==="[object Blob]"){var g=new FileReader;g.onload=function(){var C=Ci+o.type+"~"+me(this.result);s(Ot+pe+C)},g.readAsArrayBuffer(o)}else try{s(JSON.stringify(o))}catch(C){console.error("Couldn't convert value into a JSON string: ",o),s(null,C)}}function ki(o){if(o.substring(0,de)!==Ot)return JSON.parse(o);var s,a=o.substring(ln),m=o.substring(de,ln);if(m===pe&&Qe.test(a)){var f=a.match(Qe);s=f[1],a=a.substring(f[0].length)}var g=dn(a);switch(m){case fe:return g;case pe:return w([g],{type:s});case tn:return new Int8Array(g);case en:return new Uint8Array(g);case nn:return new Uint8ClampedArray(g);case on:return new Int16Array(g);case sn:return new Uint16Array(g);case rn:return new Int32Array(g);case an:return new Uint32Array(g);case cn:return new Float32Array(g);case un:return new Float64Array(g);default:throw new Error("Unkown type: "+m)}}var ge={serialize:xi,deserialize:ki,stringToBuffer:dn,bufferToString:me};function fn(o,s,a,m){o.executeSql("CREATE TABLE IF NOT EXISTS "+s.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,m)}function Ei(o){var s=this,a={db:null};if(o)for(var m in o)a[m]=typeof o[m]!="string"?o[m].toString():o[m];var f=new S(function(g,C){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(x){return C(x)}a.db.transaction(function(x){fn(x,a,function(){s._dbInfo=a,g()},function(E,M){C(M)})},C)});return a.serializer=ge,f}function dt(o,s,a,m,f,g){o.executeSql(a,m,f,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[s.storeName],function(E,M){M.rows.length?g(E,x):fn(E,s,function(){E.executeSql(a,m,f,g)},g)},g):g(C,x)},g)}function zi(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[o],function(E,M){var _=M.rows.length?M.rows.item(0).value:null;_&&(_=C.serializer.deserialize(_)),f(_)},function(E,M){g(M)})})}).catch(g)});return k(m,s),m}function Mi(o,s){var a=this,m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT * FROM "+C.storeName,[],function(E,M){for(var _=M.rows,A=_.length,N=0;N<A;N++){var W=_.item(N),F=W.value;if(F&&(F=C.serializer.deserialize(F)),(F=o(F,W.key,N+1))!==void 0)return void f(F)}f()},function(E,M){g(M)})})}).catch(g)});return k(m,s),m}function pn(o,s,a,m){var f=this;o=I(o);var g=new S(function(C,x){f.ready().then(function(){s===void 0&&(s=null);var E=s,M=f._dbInfo;M.serializer.serialize(s,function(_,A){A?x(A):M.db.transaction(function(N){dt(N,M,"INSERT OR REPLACE INTO "+M.storeName+" (key, value) VALUES (?, ?)",[o,_],function(){C(E)},function(W,F){x(F)})},function(N){if(N.code===N.QUOTA_ERR){if(m>0)return void C(pn.apply(f,[o,E,a,m-1]));x(N)}})})}).catch(x)});return k(g,a),g}function _i(o,s,a){return pn.apply(this,[o,s,a,1])}function Ri(o,s){var a=this;o=I(o);var m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[o],function(){f()},function(E,M){g(M)})})}).catch(g)});return k(m,s),m}function Ii(o){var s=this,a=new S(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(C){dt(C,g,"DELETE FROM "+g.storeName,[],function(){m()},function(x,E){f(E)})})}).catch(f)});return k(a,o),a}function Li(o){var s=this,a=new S(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(C){dt(C,g,"SELECT COUNT(key) as c FROM "+g.storeName,[],function(x,E){var M=E.rows.item(0).c;m(M)},function(x,E){f(E)})})}).catch(f)});return k(a,o),a}function Pi(o,s){var a=this,m=new S(function(f,g){a.ready().then(function(){var C=a._dbInfo;C.db.transaction(function(x){dt(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[o+1],function(E,M){var _=M.rows.length?M.rows.item(0).key:null;f(_)},function(E,M){g(M)})})}).catch(g)});return k(m,s),m}function Ti(o){var s=this,a=new S(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(C){dt(C,g,"SELECT key FROM "+g.storeName,[],function(x,E){for(var M=[],_=0;_<E.rows.length;_++)M.push(E.rows.item(_).key);m(M)},function(x,E){f(E)})})}).catch(f)});return k(a,o),a}function Bi(o){return new S(function(s,a){o.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,g){for(var C=[],x=0;x<g.rows.length;x++)C.push(g.rows.item(x).name);s({db:o,storeNames:C})},function(f,g){a(g)})},function(m){a(m)})})}function Ai(o,s){s=D.apply(this,arguments);var a=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var m,f=this;return k(m=o.name?new S(function(g){var C;C=o.name===a.name?f._dbInfo.db:openDatabase(o.name,"","",0),o.storeName?g({db:C,storeNames:[o.storeName]}):g(Bi(C))}).then(function(g){return new S(function(C,x){g.db.transaction(function(E){function M(W){return new S(function(F,ot){E.executeSql("DROP TABLE IF EXISTS "+W,[],function(){F()},function(yn,Pt){ot(Pt)})})}for(var _=[],A=0,N=g.storeNames.length;A<N;A++)_.push(M(g.storeNames[A]));S.all(_).then(function(){C()}).catch(function(W){x(W)})},function(E){x(E)})})}):S.reject("Invalid arguments"),s),m}var Di={_driver:"webSQLStorage",_initStorage:Ei,_support:Si(),iterate:Mi,getItem:zi,setItem:_i,removeItem:Ri,clear:Ii,length:Li,key:Pi,keys:Ti,dropInstance:Ai};function Ni(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function mn(o,s){var a=o.name+"/";return o.storeName!==s.storeName&&(a+=o.storeName+"/"),a}function Ui(){var o="_localforage_support_test";try{return localStorage.setItem(o,!0),localStorage.removeItem(o),!1}catch{return!0}}function Oi(){return!Ui()||localStorage.length>0}function ji(o){var s=this,a={};if(o)for(var m in o)a[m]=o[m];return a.keyPrefix=mn(o,s._defaultConfig),Oi()?(s._dbInfo=a,a.serializer=ge,S.resolve()):S.reject()}function Wi(o){var s=this,a=s.ready().then(function(){for(var m=s._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var g=localStorage.key(f);g.indexOf(m)===0&&localStorage.removeItem(g)}});return k(a,o),a}function Fi(o,s){var a=this;o=I(o);var m=a.ready().then(function(){var f=a._dbInfo,g=localStorage.getItem(f.keyPrefix+o);return g&&(g=f.serializer.deserialize(g)),g});return k(m,s),m}function $i(o,s){var a=this,m=a.ready().then(function(){for(var f=a._dbInfo,g=f.keyPrefix,C=g.length,x=localStorage.length,E=1,M=0;M<x;M++){var _=localStorage.key(M);if(_.indexOf(g)===0){var A=localStorage.getItem(_);if(A&&(A=f.serializer.deserialize(A)),(A=o(A,_.substring(C),E++))!==void 0)return A}}});return k(m,s),m}function Hi(o,s){var a=this,m=a.ready().then(function(){var f,g=a._dbInfo;try{f=localStorage.key(o)}catch{f=null}return f&&(f=f.substring(g.keyPrefix.length)),f});return k(m,s),m}function qi(o){var s=this,a=s.ready().then(function(){for(var m=s._dbInfo,f=localStorage.length,g=[],C=0;C<f;C++){var x=localStorage.key(C);x.indexOf(m.keyPrefix)===0&&g.push(x.substring(m.keyPrefix.length))}return g});return k(a,o),a}function Gi(o){var s=this.keys().then(function(a){return a.length});return k(s,o),s}function Xi(o,s){var a=this;o=I(o);var m=a.ready().then(function(){var f=a._dbInfo;localStorage.removeItem(f.keyPrefix+o)});return k(m,s),m}function Vi(o,s,a){var m=this;o=I(o);var f=m.ready().then(function(){s===void 0&&(s=null);var g=s;return new S(function(C,x){var E=m._dbInfo;E.serializer.serialize(s,function(M,_){if(_)x(_);else try{localStorage.setItem(E.keyPrefix+o,M),C(g)}catch(A){A.name!=="QuotaExceededError"&&A.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(A),x(A)}})})});return k(f,a),f}function Ki(o,s){if(s=D.apply(this,arguments),!(o=typeof o!="function"&&o||{}).name){var a=this.config();o.name=o.name||a.name,o.storeName=o.storeName||a.storeName}var m,f=this;return k(m=o.name?new S(function(g){o.storeName?g(mn(o,f._defaultConfig)):g(o.name+"/")}).then(function(g){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(g)===0&&localStorage.removeItem(x)}}):S.reject("Invalid arguments"),s),m}var Yi={_driver:"localStorageWrapper",_initStorage:ji,_support:Ni(),iterate:$i,getItem:Fi,setItem:Vi,removeItem:Xi,clear:Wi,length:Gi,key:Hi,keys:qi,dropInstance:Ki},Ji=function(o,s){return o===s||typeof o=="number"&&typeof s=="number"&&isNaN(o)&&isNaN(s)},Zi=function(o,s){for(var a=o.length,m=0;m<a;){if(Ji(o[m],s))return!0;m++}return!1},gn=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},Lt={},vn={},Et={INDEXEDDB:bi,WEBSQL:Di,LOCALSTORAGE:Yi},Qi=[Et.INDEXEDDB._driver,Et.WEBSQL._driver,Et.LOCALSTORAGE._driver],jt=["dropInstance"],ve=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(jt),to={description:"",driver:Qi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function eo(o,s){o[s]=function(){var a=arguments;return o.ready().then(function(){return o[s].apply(o,a)})}}function ye(){for(var o=1;o<arguments.length;o++){var s=arguments[o];if(s)for(var a in s)s.hasOwnProperty(a)&&(gn(s[a])?arguments[0][a]=s[a].slice():arguments[0][a]=s[a])}return arguments[0]}var no=new(function(){function o(s){for(var a in r(this,o),Et)if(Et.hasOwnProperty(a)){var m=Et[a],f=m._driver;this[a]=f,Lt[f]||this.defineDriver(m)}this._defaultConfig=ye({},to),this._config=ye({},this._defaultConfig,s),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return o.prototype.config=function(s){if((s===void 0?"undefined":i(s))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var a in s){if(a==="storeName"&&(s[a]=s[a].replace(/\W/g,"_")),a==="version"&&typeof s[a]!="number")return new Error("Database version must be a number.");this._config[a]=s[a]}return!("driver"in s)||!s.driver||this.setDriver(this._config.driver)}return typeof s=="string"?this._config[s]:this._config},o.prototype.defineDriver=function(s,a,m){var f=new S(function(g,C){try{var x=s._driver,E=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!s._driver)return void C(E);for(var M=ve.concat("_initStorage"),_=0,A=M.length;_<A;_++){var N=M[_];if((!Zi(jt,N)||s[N])&&typeof s[N]!="function")return void C(E)}(function(){for(var F=function(io){return function(){var oo=new Error("Method "+io+" is not implemented by the current driver"),wn=S.reject(oo);return k(wn,arguments[arguments.length-1]),wn}},ot=0,yn=jt.length;ot<yn;ot++){var Pt=jt[ot];s[Pt]||(s[Pt]=F(Pt))}})();var W=function(F){Lt[x]&&console.info("Redefining LocalForage driver: "+x),Lt[x]=s,vn[x]=F,g()};"_support"in s?s._support&&typeof s._support=="function"?s._support().then(W,C):W(!!s._support):W(!0)}catch(F){C(F)}});return z(f,a,m),f},o.prototype.driver=function(){return this._driver||null},o.prototype.getDriver=function(s,a,m){var f=Lt[s]?S.resolve(Lt[s]):S.reject(new Error("Driver not found."));return z(f,a,m),f},o.prototype.getSerializer=function(s){var a=S.resolve(ge);return z(a,s),a},o.prototype.ready=function(s){var a=this,m=a._driverSet.then(function(){return a._ready===null&&(a._ready=a._initDriver()),a._ready});return z(m,s,s),m},o.prototype.setDriver=function(s,a,m){var f=this;gn(s)||(s=[s]);var g=this._getSupportedDrivers(s);function C(){f._config.driver=f.driver()}function x(_){return f._extend(_),C(),f._ready=f._initStorage(f._config),f._ready}function E(_){return function(){var A=0;function N(){for(;A<_.length;){var W=_[A];return A++,f._dbInfo=null,f._ready=null,f.getDriver(W).then(x).catch(N)}C();var F=new Error("No available storage method found.");return f._driverSet=S.reject(F),f._driverSet}return N()}}var M=this._driverSet!==null?this._driverSet.catch(function(){return S.resolve()}):S.resolve();return this._driverSet=M.then(function(){var _=g[0];return f._dbInfo=null,f._ready=null,f.getDriver(_).then(function(A){f._driver=A._driver,C(),f._wrapLibraryMethodsWithReady(),f._initDriver=E(g)})}).catch(function(){C();var _=new Error("No available storage method found.");return f._driverSet=S.reject(_),f._driverSet}),z(this._driverSet,a,m),this._driverSet},o.prototype.supports=function(s){return!!vn[s]},o.prototype._extend=function(s){ye(this,s)},o.prototype._getSupportedDrivers=function(s){for(var a=[],m=0,f=s.length;m<f;m++){var g=s[m];this.supports(g)&&a.push(g)}return a},o.prototype._wrapLibraryMethodsWithReady=function(){for(var s=0,a=ve.length;s<a;s++)eo(this,ve[s])},o.prototype.createInstance=function(s){return new o(s)},o}());t.exports=no},{3:3}]},{},[4])(4),$n={exports:{}};/*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */(function(e){$n.exports=(()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,i=!1;const r=t.WebStreamsPolyfill||{},c=t.isSecureContext;let v=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const y=c||"MozAppearance"in document.documentElement.style?"iframe":"navigate",w={createWriteStream:function(k,z,I){let D={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},P=0,b=null,u=null,d=null;if(Number.isFinite(z)?([I,z]=[z,I],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=I,D.writableStrategy=z):z&&z.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=I,D.writableStrategy=z):D=z||{},!v){n||(n=c?S(w.mitm):function(T){const R="width=200,height=100",B=document.createDocumentFragment(),U={frame:t.open(T,"popup",R),loaded:!1,isIframe:!1,isPopup:!0,remove(){U.frame.close()},addEventListener(...j){B.addEventListener(...j)},dispatchEvent(...j){B.dispatchEvent(...j)},removeEventListener(...j){B.removeEventListener(...j)},postMessage(...j){U.frame.postMessage(...j)}},O=j=>{j.source===U.frame&&(U.loaded=!0,t.removeEventListener("message",O),U.dispatchEvent(new Event("load")))};return t.addEventListener("message",O),U}(w.mitm)),u=new MessageChannel,k=encodeURIComponent(k.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const l={transferringReadable:i,pathname:D.pathname||Math.random().toString().slice(-6)+"/"+k,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+k}};D.size&&(l.headers["Content-Length"]=D.size);const p=[l,"*",[u.port2]];if(i){const T=y==="iframe"?void 0:{transform(B,U){if(!(B instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");P+=B.length,U.enqueue(B),b&&(location.href=b,b=null)},flush(){b&&(location.href=b)}};d=new w.TransformStream(T,D.writableStrategy,D.readableStrategy);const R=d.readable;u.port1.postMessage({readableStream:R},[R])}u.port1.onmessage=T=>{T.data.download?y==="navigate"?(n.remove(),n=null,P?location.href=T.data.download:b=T.data.download):(n.isPopup&&(n.remove(),n=null,y==="iframe"&&S(w.mitm)),S(T.data.download)):T.data.abort&&(h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...p):n.addEventListener("load",()=>{n.postMessage(...p)},{once:!0})}let h=[];return!v&&d&&d.writable||new w.WritableStream({write(l){if(!(l instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");v?h.push(l):(u.port1.postMessage(l),P+=l.length,b&&(location.href=b,b=null))},close(){if(v){const l=new Blob(h,{type:"application/octet-stream; charset=utf-8"}),p=document.createElement("a");p.href=URL.createObjectURL(l),p.download=k,p.click()}else u.port1.postMessage("end")},abort(){h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},D.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 S(k){if(!k)throw new Error("meh");const z=document.createElement("iframe");return z.hidden=!0,z.src=k,z.loaded=!1,z.name="iframe",z.isIframe=!0,z.postMessage=(...I)=>z.contentWindow.postMessage(...I),z.addEventListener("load",()=>{z.loaded=!0},{once:!0}),document.body.appendChild(z),z}try{new Response(new ReadableStream),c&&!("serviceWorker"in navigator)&&(v=!0)}catch{v=!0}return(k=>{try{k()}catch{}})(()=>{const{readable:k}=new TransformStream,z=new MessageChannel;z.port1.postMessage(k,[k]),z.port1.close(),z.port2.close(),i=!0,Object.defineProperty(w,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),w})()})();var ar=$n.exports;class cr{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,i=3,r=6,c=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=Me(),this.initIndexDB(),r>=3&&(this.cacheSize=r),c>this.requestTimeout&&(this.requestTimeout=c)}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="",i){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await rt(n,t,i);let c=null;return r&&r.status===200&&(c=r.data),c}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Kt.createInstance({name:this.fileID,driver:Kt.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(),Kt.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 i=t;if(!i&&this.downloadURL&&(i=this.downloadURL),!i)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=L.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const c={key:this.fileMetaData?.downloadID};let v=0;const y=this.cacheSize;let w=0;for(let S=0;S<this.totalChunks;S++){if(this.keys&&this.keys?.indexOf(S.toString())>=0){v++,v>this.finishNum&&(this.finishNum=v,this.downloadProgress());continue}const k=S*this.chunkByteSize;let z=k+this.chunkByteSize-1;this.fileMetaData&&z>this.fileMetaData.length&&(z=this.fileMetaData.length-1);const I={range:`bytes=${k}-${z}`};for(;w>=y;)await this.sleep(200);const D=S.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${S+1}/${this.totalChunks}`),w++,rt(i,n,c,I,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async P=>{const b=P.data;w--,await this.currentDB?.setItem(D,b),v++,v>this.finishNum&&(this.finishNum=v,this.downloadProgress());const u=parseInt(D)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(P=>{w--;const b=parseInt(D)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${b}\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=ar.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const r=i.toString();let c=await this.currentDB?.getItem(r);if(c||(c=await this.currentDB?.getItem(r)),!c)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let v=new Response(c).body;if(v===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const y=v.getReader();for(;;){const{done:w,value:S}=await y.read();if(w)break;await t.write(S)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Kt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}const ur=Object.prototype.toString;function Y(e,t){return ur.call(e)===`[object ${t}]`}function De(e){return Y(e,"Function")}const Hn=e=>e!==void 0,Ne=e=>!Hn(e);function Ue(e){return e===null}function lr(e){return Ne(e)&&Ue(e)}function hr(e){return Ne(e)||Ue(e)}const xt=e=>e!==null&&Y(e,"Object");function dr(e){return Y(e,"Date")}function fr(e){return Y(e,"Number")}function pr(e){return Y(e,"AsyncFunction")}function mr(e){return Y(e,"Promise")&&xt(e)&&De(e.then)&&De(e.catch)}function Yt(e){return Y(e,"String")}function gr(e){return e===!0||e===!1||Y(e,"Boolean")}function qn(e){return e&&Array.isArray(e)}const vr=()=>typeof window<"u",yr=e=>typeof window<"u"&&Y(e,"Window"),wr=e=>xt(e)&&!!e.tagName,br=typeof window>"u";function Sr(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function Cr(e){return e==null||(Yt(e)||qn(e)?e.length===0:!!xt(e)&&JSON.stringify(e)==="{}")}function xr(e){return Y(e,"Error")}function kr(e){return Y(e,"WeakSet")}function Er(e){return Y(e,"WeakMap")}function zr(e){return Y(e,"Symbol")}function Mr(e){return Y(e,"Map")}const _r=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);function Rr(e,t){let n="",i="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,i}function Gn(e={},t={}){let n;for(n in t)e[n]=xt(e[n])?Gn(e[n],t[n]):e[n]=t[n];return e}function Xn(e){const t=function(w){if(!w)return;const S=w,k=[];if(S)for(let z of S){const I=Vn(z);I&&k.push(I)}return k}(e.bussinessRoutes),n=function(w){if(!w)return;const S=w;if(S&&S.length>0){const k=[];return S.forEach(z=>{const I=Kn(z);I&&k.push(I)}),k}}(e.widgetMenuConfig),i=function(w){if(!!w&&w.length>0){const S=[];return w.forEach(k=>{const z=function(I){if(!!I)return{id:I.id,label:I.label,container:I.container,preload:I.preload,afterid:I.afterid,bindid:I.bindid,group:I.group}}(k);z&&S.push(z)}),S}}(e.widgetConfig),r=(c=e.functionList)&&c.length>0?c:void 0;var c;const v=e.pkgObject.version,y=e.pkgObject.name;return{id:function(w,S){const k=`${w}_${S}`;return lt.MD5(k)}(y,v),name:L.Config.UI.SiteTitle,group:L.Config.UI.Group,product:y,version:v,routes:t,widgetMenu:n,widgets:i,functions:r}}function Vn(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 i=[];for(let r of e.children){const c=Vn(r);c&&i.push(c)}i.length>0&&(n.children=i)}return n}}function Kn(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 i=Kn(n);i&&t.children?.push(i)})),t}function Ir(e,t="IconifyList.ts"){let n="",i=`const iconlist={
4
- `,r=0;e.forEach(c=>{const v=c.split(":");if(v&&v.length===2){const y="icon"+r;n+=`import ${y} from '~icons/${v[0]}/${v[1]}'
5
- `,i+=` '${c}':${y},
6
- `,r++}}),r>0&&(i+=`};
7
- `,Xt(n+i+"export default iconlist;","IconifyList.ts"))}function Lr(e,t){const n=Xn(e);Pn(n,t),L.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}const J=bn({panelGroups:{}}),Yn=()=>({useGroupAccordion:e=>pt(()=>J.panelGroups[e].accordion),setGroupAccordionStatus:(e,t)=>{J.panelGroups[e]={...J.panelGroups[e],accordion:t}},panelExpanded:(e,t)=>pt(()=>J.panelGroups[e]?.panelExpandStatus?.[t]||!1),setPanelExpandedStatus:(e,t,n)=>{J.panelGroups[e]={...J.panelGroups[e],panelExpandStatus:{...J.panelGroups[e]?.panelExpandStatus||{},[t]:n}}},togglePanelExpandedStatus:(e,t)=>{J.panelGroups[e].accordion&&(J.panelGroups[e].panelExpandStatus[t]||Object.keys(J.panelGroups[e].panelExpandStatus).forEach(n=>{J.panelGroups[e].panelExpandStatus[n]=!1})),J.panelGroups[e].panelExpandStatus[t]=!J.panelGroups[e].panelExpandStatus[t]}}),Oe=e=>e>255?255:e<0?0:e,Jt=(e,t)=>{const n=e.replace("#",""),i=parseInt(n,16),r=Oe((i>>16)+t),c=Oe((i>>8&255)+t);return"#"+(Oe((255&i)+t)|c<<8|r<<16).toString(16)};var Zt=Tt({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(e){const t=nt(`group-${qt()}`),{setGroupAccordionStatus:n}=Yn(),i={"--base-color":e.baseColor,"--border-color":Jt(e.baseColor,180),"--bg-color-header":Jt(e.baseColor,140),"--bg-color-header-hover":Jt(e.baseColor,190),"--bg-color-header-active":Jt(e.baseColor,200),"--bg-color-body":"#fff"};return n(t.value,e.accordion),{idGroup:t,cssColorVars:i}}});const Pr=["data-id-group"];Zt.render=function(e,t,n,i,r,c){return H(),tt("div",{"data-id-group":e.idGroup,style:yt(e.cssColorVars),class:"vcpg"},[ft(e.$slots,"default")],12,Pr)},Zt.__scopeId="data-v-23ab5317",Zt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Qt=Tt({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(e,t){const n=`panel-${qt()}`,i=nt(),r=nt(),c=nt(),{panelExpanded:v,togglePanelExpandedStatus:y,setPanelExpandedStatus:w}=Yn(),S=pt(()=>({hasContent:t.slots.content&&t.slots.content()[0].children.length>0,dataKey:qt()})),k=pt(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),z=pt(()=>v(k.value,n).value&&S.value.hasContent);return Sn(()=>{w(k.value,n,e.expanded)}),so(()=>{(async()=>(await Cn(),r.value&&c.value&&(r.value.style.height=`${Math.min(c.value.scrollHeight,r.value.scrollHeight)}px`)))()}),{body:S,panelRef:i,bodyRef:r,bodyContentRef:c,isExpanded:z,collapse:I=>{I.style.height="0"},expand:I=>{I.style.height=`${I.scrollHeight}px`},toggle:()=>{S.value.hasContent&&y(k.value,n)},toggleIcon:`
1
+ import{h as ro,openBlock as H,createElementBlock as et,normalizeStyle as gt,renderSlot as dt,reactive as Sn,computed as ft,defineComponent as Lt,ref as nt,onMounted as we,onUpdated as so,nextTick as Ot,normalizeClass as ao,createElementVNode as V,createCommentVNode as kt,createVNode as Cn,Transition as xn,withCtx as jt,withModifiers as kn,getCurrentInstance as co,watch as Wt,onBeforeUnmount as uo,createTextVNode as En,resolveComponent as zn,createBlock as ct,withDirectives as lo,Fragment as vt,toDisplayString as ho,vShow as fo,markRaw as In,toRefs as po,renderList as Et,resolveDynamicComponent as yt}from"vue";import mo from"axios";import{Client as go,ClientContext as be}from"@hprose/rpc-core";import{ByteStream as _n}from"@hprose/io";import{HttpTransport as vo}from"@hprose/rpc-html5";var yo={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((i,o)=>(i.size=o===t?i.max:i.min,o!==t&&(n+=i.min),i)),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:i}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:i-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 i=0+(this.pushOtherPanes?0:n.prevPanesSize),o=100-(this.pushOtherPanes?0:n.nextPanesSize),s=Math.max(Math.min(this.getCurrentDragPercentage(e),o),i);let g=[t,t+1],y=this.panes[g[0]]||null,w=this.panes[g[1]]||null;const S=y.max<100&&s>=y.max+n.prevPanesSize,k=w.max<100&&s<=100-(w.max+this.sumNextPanesSize(t+1));if(S||k)S?(y.size=y.max,w.size=Math.max(100-y.max-n.prevPanesSize-n.nextPanesSize,0)):(y.size=Math.max(100-w.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),w.size=w.max);else{if(this.pushOtherPanes){const z=this.doPushOtherPanes(n,s);if(!z)return;({sums:n,panesToResize:g}=z),y=this.panes[g[0]]||null,w=this.panes[g[1]]||null}y!==null&&(y.size=Math.min(Math.max(s-n.prevPanesSize-n.prevReachedMinPanes,y.min),y.max)),w!==null&&(w.size=Math.min(Math.max(100-s-n.nextPanesSize-n.nextReachedMinPanes,w.min),w.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,i=[n,n+1];return t<e.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((o,s)=>{s>i[0]&&s<=n&&(o.size=o.min,e.prevReachedMinPanes+=o.min)}),e.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((o,s)=>{s>0&&s<=n&&(o.size=o.min,e.prevReachedMinPanes+=o.min)}),this.panes[i[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((o,s)=>{s>n&&s<i[1]&&(o.size=o.min,e.nextReachedMinPanes+=o.min)}),e.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((o,s)=>{s<this.panesCount-1&&s>=n+1&&(o.size=o.min,e.nextReachedMinPanes+=o.min)}),this.panes[i[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:i}},sumPrevPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,i)=>t+(i>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 i=e-1,o=document.createElement("div");o.classList.add("splitpanes__splitter"),n||(o.onmousedown=s=>this.onMouseDown(s,i),typeof window<"u"&&"ontouchstart"in window&&(o.ontouchstart=s=>this.onMouseDown(s,i)),o.onclick=s=>this.onSplitterClick(s,i+1)),this.dblClickSplitter&&(o.ondblclick=s=>this.onSplitterDblClick(s,i+1)),t.parentNode.insertBefore(o,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(([i,o])=>n[i]=o)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(o=>(o.className.includes("splitpanes__pane")&&t++,o===e.$el));const n=parseFloat(e.minSize),i=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((o,s)=>o.index=s),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(i=>i.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((i,o)=>i.index=o),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.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=[],i=[];this.panes.forEach(o=>{o.size=Math.max(Math.min(e,o.max),o.min),t-=o.size,o.size>=o.max&&n.push(o.id),o.size<=o.min&&i.push(o.id)}),t>.1&&this.readjustSizes(t,n,i)},initialPanesSizing(){let e=100;const t=[],n=[];let i=0;this.panes.forEach(s=>{e-=s.size,s.size!==null&&i++,s.size>=s.max&&t.push(s.id),s.size<=s.min&&n.push(s.id)});let o=100;e>.1&&(this.panes.forEach(s=>{s.size===null&&(s.size=Math.max(Math.min(e/(this.panesCount-i),s.max),s.min)),o-=s.size}),o>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const i=[],o=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(s=>{n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&o.push(s.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(s=>{e&&e.givenSize!==null&&e.id===s.id||(s.size=Math.max(Math.min(t,s.max),s.min)),n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&o.push(s.id)}),n>.1&&this.readjustSizes(n,i,o))},readjustSizes(e,t,n){let i;i=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(o=>{if(e>0&&!t.includes(o.id)){const s=Math.max(Math.min(o.size+i,o.max),o.min);e-=s-o.size,o.size=s}else if(!n.includes(o.id)){const s=Math.max(Math.min(o.size+i,o.max),o.min);e-=s-o.size,o.size=s}o.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[o.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?i=>this.onSplitterDblClick(i,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 ro("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},Se={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})}}};Se.render=function(e,t,n,i,o,s){return H(),et("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=g=>s.onPaneClick(g,e._.uid)),style:gt(e.style)},[dt(e.$slots,"default")],4)},Se.__file="src/controls/splitpanes/pane.vue";var zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},wo={exports:{}},Mn=wo.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(b,u){var d=b[0],h=b[1],l=b[2],p=b[3];h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[0]-680876936|0)<<7|d>>>25)+h|0)&h|~d&l)+u[1]-389564586|0)<<12|p>>>20)+d|0)&d|~p&h)+u[2]+606105819|0)<<17|l>>>15)+p|0)&p|~l&d)+u[3]-1044525330|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[4]-176418897|0)<<7|d>>>25)+h|0)&h|~d&l)+u[5]+1200080426|0)<<12|p>>>20)+d|0)&d|~p&h)+u[6]-1473231341|0)<<17|l>>>15)+p|0)&p|~l&d)+u[7]-45705983|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[8]+1770035416|0)<<7|d>>>25)+h|0)&h|~d&l)+u[9]-1958414417|0)<<12|p>>>20)+d|0)&d|~p&h)+u[10]-42063|0)<<17|l>>>15)+p|0)&p|~l&d)+u[11]-1990404162|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&l|~h&p)+u[12]+1804603682|0)<<7|d>>>25)+h|0)&h|~d&l)+u[13]-40341101|0)<<12|p>>>20)+d|0)&d|~p&h)+u[14]-1502002290|0)<<17|l>>>15)+p|0)&p|~l&d)+u[15]+1236535329|0)<<22|h>>>10)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[1]-165796510|0)<<5|d>>>27)+h|0)&l|h&~l)+u[6]-1069501632|0)<<9|p>>>23)+d|0)&h|d&~h)+u[11]+643717713|0)<<14|l>>>18)+p|0)&d|p&~d)+u[0]-373897302|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[5]-701558691|0)<<5|d>>>27)+h|0)&l|h&~l)+u[10]+38016083|0)<<9|p>>>23)+d|0)&h|d&~h)+u[15]-660478335|0)<<14|l>>>18)+p|0)&d|p&~d)+u[4]-405537848|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[9]+568446438|0)<<5|d>>>27)+h|0)&l|h&~l)+u[14]-1019803690|0)<<9|p>>>23)+d|0)&h|d&~h)+u[3]-187363961|0)<<14|l>>>18)+p|0)&d|p&~d)+u[8]+1163531501|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h&p|l&~p)+u[13]-1444681467|0)<<5|d>>>27)+h|0)&l|h&~l)+u[2]-51403784|0)<<9|p>>>23)+d|0)&h|d&~h)+u[7]+1735328473|0)<<14|l>>>18)+p|0)&d|p&~d)+u[12]-1926607734|0)<<20|h>>>12)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[5]-378558|0)<<4|d>>>28)+h|0)^h^l)+u[8]-2022574463|0)<<11|p>>>21)+d|0)^d^h)+u[11]+1839030562|0)<<16|l>>>16)+p|0)^p^d)+u[14]-35309556|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[1]-1530992060|0)<<4|d>>>28)+h|0)^h^l)+u[4]+1272893353|0)<<11|p>>>21)+d|0)^d^h)+u[7]-155497632|0)<<16|l>>>16)+p|0)^p^d)+u[10]-1094730640|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[13]+681279174|0)<<4|d>>>28)+h|0)^h^l)+u[0]-358537222|0)<<11|p>>>21)+d|0)^d^h)+u[3]-722521979|0)<<16|l>>>16)+p|0)^p^d)+u[6]+76029189|0)<<23|h>>>9)+l|0,h=((h+=((l=((l+=((p=((p+=((d=((d+=(h^l^p)+u[9]-640364487|0)<<4|d>>>28)+h|0)^h^l)+u[12]-421815835|0)<<11|p>>>21)+d|0)^d^h)+u[15]+530742520|0)<<16|l>>>16)+p|0)^p^d)+u[2]-995338651|0)<<23|h>>>9)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[0]-198630844|0)<<6|d>>>26)+h|0)|~l))+u[7]+1126891415|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[14]-1416354905|0)<<15|l>>>17)+p|0)|~d))+u[5]-57434055|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[12]+1700485571|0)<<6|d>>>26)+h|0)|~l))+u[3]-1894986606|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[10]-1051523|0)<<15|l>>>17)+p|0)|~d))+u[1]-2054922799|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[8]+1873313359|0)<<6|d>>>26)+h|0)|~l))+u[15]-30611744|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[6]-1560198380|0)<<15|l>>>17)+p|0)|~d))+u[13]+1309151649|0)<<21|h>>>11)+l|0,h=((h+=((p=((p+=(h^((d=((d+=(l^(h|~p))+u[4]-145523070|0)<<6|d>>>26)+h|0)|~l))+u[11]-1120210379|0)<<10|p>>>22)+d|0)^((l=((l+=(d^(p|~h))+u[2]+718787259|0)<<15|l>>>17)+p|0)|~d))+u[9]-343485551|0)<<21|h>>>11)+l|0,b[0]=d+b[0]|0,b[1]=h+b[1]|0,b[2]=l+b[2]|0,b[3]=p+b[3]|0}function i(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b.charCodeAt(u)+(b.charCodeAt(u+1)<<8)+(b.charCodeAt(u+2)<<16)+(b.charCodeAt(u+3)<<24);return d}function o(b){var u,d=[];for(u=0;u<64;u+=4)d[u>>2]=b[u]+(b[u+1]<<8)+(b[u+2]<<16)+(b[u+3]<<24);return d}function s(b){var u,d,h,l,p,P,L=b.length,R=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(R,i(b.substring(u-64,u)));for(d=(b=b.substring(u-64)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b.charCodeAt(u)<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(R,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*L).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),P=parseInt(l[1],16)||0,h[14]=p,h[15]=P,n(R,h),R}function g(b){var u,d,h,l,p,P,L=b.length,R=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(R,o(b.subarray(u-64,u)));for(d=(b=u-64<L?b.subarray(u-64):new Uint8Array(0)).length,h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<d;u+=1)h[u>>2]|=b[u]<<(u%4<<3);if(h[u>>2]|=128<<(u%4<<3),u>55)for(n(R,h),u=0;u<16;u+=1)h[u]=0;return l=(l=8*L).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(l[2],16),P=parseInt(l[1],16)||0,h[14]=p,h[15]=P,n(R,h),R}function y(b){var u,d="";for(u=0;u<4;u+=1)d+=t[b>>8*u+4&15]+t[b>>8*u&15];return d}function w(b){var u;for(u=0;u<b.length;u+=1)b[u]=y(b[u]);return b.join("")}function S(b){return/[\u0080-\uFFFF]/.test(b)&&(b=unescape(encodeURIComponent(b))),b}function k(b,u){var d,h=b.length,l=new ArrayBuffer(h),p=new Uint8Array(l);for(d=0;d<h;d+=1)p[d]=b.charCodeAt(d);return u?p:l}function z(b){return String.fromCharCode.apply(null,new Uint8Array(b))}function B(b,u,d){var h=new Uint8Array(b.byteLength+u.byteLength);return h.set(new Uint8Array(b)),h.set(new Uint8Array(u),b.byteLength),d?h:h.buffer}function A(b){var u,d=[],h=b.length;for(u=0;u<h-1;u+=2)d.push(parseInt(b.substr(u,2),16));return String.fromCharCode.apply(String,d)}function D(){this.reset()}return w(s("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function b(u,d){return(u=0|u||0)<0?Math.max(u+d,0):Math.min(u,d)}ArrayBuffer.prototype.slice=function(u,d){var h,l,p,P,L=this.byteLength,R=b(u,L),U=L;return d!==e&&(U=b(d,L)),R>U?new ArrayBuffer(0):(h=U-R,l=new ArrayBuffer(h),p=new Uint8Array(l),P=new Uint8Array(this,R,h),p.set(P),l)}}(),D.prototype.append=function(b){return this.appendBinary(S(b)),this},D.prototype.appendBinary=function(b){this._buff+=b,this._length+=b.length;var u,d=this._buff.length;for(u=64;u<=d;u+=64)n(this._hash,i(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},D.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h.charCodeAt(u)<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=A(d)),this.reset(),d},D.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},D.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},D.prototype.setState=function(b){return this._buff=b.buff,this._length=b.length,this._hash=b.hash,this},D.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},D.prototype._finish=function(b,u){var d,h,l,p=u;if(b[p>>2]|=128<<(p%4<<3),p>55)for(n(this._hash,b),p=0;p<16;p+=1)b[p]=0;d=(d=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),h=parseInt(d[2],16),l=parseInt(d[1],16)||0,b[14]=h,b[15]=l,n(this._hash,b)},D.hash=function(b,u){return D.hashBinary(S(b),u)},D.hashBinary=function(b,u){var d=w(s(b));return u?A(d):d},D.ArrayBuffer=function(){this.reset()},D.ArrayBuffer.prototype.append=function(b){var u,d=B(this._buff.buffer,b,!0),h=d.length;for(this._length+=b.byteLength,u=64;u<=h;u+=64)n(this._hash,o(d.subarray(u-64,u)));return this._buff=u-64<h?new Uint8Array(d.buffer.slice(u-64)):new Uint8Array(0),this},D.ArrayBuffer.prototype.end=function(b){var u,d,h=this._buff,l=h.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<l;u+=1)p[u>>2]|=h[u]<<(u%4<<3);return this._finish(p,l),d=w(this._hash),b&&(d=A(d)),this.reset(),d},D.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},D.ArrayBuffer.prototype.getState=function(){var b=D.prototype.getState.call(this);return b.buff=z(b.buff),b},D.ArrayBuffer.prototype.setState=function(b){return b.buff=k(b.buff,!0),D.prototype.setState.call(this,b)},D.ArrayBuffer.prototype.destroy=D.prototype.destroy,D.ArrayBuffer.prototype._finish=D.prototype._finish,D.ArrayBuffer.hash=function(b,u){var d=w(g(new Uint8Array(b)));return u?A(d):d},D}();const Ce=[];class ot{static addHandler(t,n,i){t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent?t.attachEvent("on"+n,i):t["on"+n]=i}static windowResizeHandler(t){ot.addHandler(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 i=window.document;let o=window.document.exitFullscreen||i.msExitFullscreen||i.mozCancelFullScreen||i.webkitCancelFullScreen;typeof o<"u"&&o?o.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let i=t;i||(i=window.document.documentElement);let o=i.requestFullScreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullScreen;typeof o<"u"&&o?o.call(i):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(t=window.document.documentElement){let n=t;var i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i)i.call(n);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.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 i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ot.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 i=ot.isFullScreen();t(i)}):document.addEventListener("MSFullscreenChange",function(){const i=ot.isFullScreen();t(i)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Ce.indexOf(n)!==-1)return;Ce.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,ot.stringifyCircularHandler);return Ce.length=0,n}static jsonParse(t){const n=ot.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const i=window;return i.createObjcectURL!=null?n=i.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const i=File.prototype,o=i.slice||i.mozSlice||i.webkitSlice,s=t,g=2097152,y=new Mn.ArrayBuffer,w=new FileReader;w.onload=function(S){y.append(S.target?.result);const k=y.end();n({isOK:!0,data:k})},w.onerror=function(){const S="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(S),n({isOK:!1,data:S})},function(){const S=0+g>=s.size?s.size:0+g;w.readAsArrayBuffer(o.call(s,0,S))}()}static MD5(t,n=!1){return Mn.hash(t,n)}static copyText=t=>new Promise((n,i)=>{const o=document.createElement("input");o.value=t,document.body.appendChild(o),o.select(),document.execCommand("copy"),o.remove(),n(!0)});static setGrayMode(t){ot.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,n,i){const o=i||document.body;let{className:s}=o;s=s.replace(n,""),o.className=t?`${s} ${n} `:s}static setCssVar(t,n,i=document.documentElement){i.style.setProperty(t,n)}}class Ft{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,i)=>i.toUpperCase()).replace("views","")}}class $t{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,i=604800){const o=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(t),o)}get(t,n=null){const i=this.storage.getItem(this.getKey(t));if(i)try{const o=JSON.parse(i),{value:s,expire:g}=o;if(g===null||g>=Date.now())return s;this.remove(this.getKey(t))}catch{return n}return n}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,i=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${i}`}getCookie(t){const n=document.cookie.split("; ");for(let i=0,o=n.length;i<o;i++){const s=n[i].split("=");if(s[0]===this.getKey(t))return s[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 bo=new $t("",localStorage);function Ht(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const o=Math.floor(16*Math.random());e[n]=t.substring(o,o+1)}e[14]="4";const i=3&Number(e[19])|8;return e[19]=t.substring(i,i+1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function So(){var e=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function Co(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),i=Math.floor(n*parseInt(t[0])+255*(1-n)),o=Math.floor(n*parseInt(t[1])+255*(1-n)),s=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)+("0"+s.toString(16)).slice(-2)}function xo(e){var t=e.toLowerCase();if(qt(e)){if(t.length===4){for(var n="#",i=1;i<4;i+=1){const s=t.slice(i,i+1);n+=s.concat(s)}t=n}var o=[];for(i=1;i<7;i+=2)o.push(parseInt("0x"+t.slice(i,i+2)));return"rgb("+o.join(",")+")"}return t}function ko(e){const t=e;if(t.length===4){let i="#";for(var n=1;n<4;n+=1){const o=t.slice(n,n+1);i+=o.concat(o)}return i}return t}var wt;function Eo(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?wt.Hex:t==="r"||t==="("?wt.RGBA:t==="h"?wt.Hsla:wt.RGBA}function zo(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,i,o,s=(parseFloat(t[1])%360+360)%360/360,g=parseFloat(t[2])/(/%$/.test(t[2])?100:1),y=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(g===0)n=i=o=y;else{var w=y<=.5?y*(g+1):y+g-y*g,S=2*y-w;n=xe(S,w,s+1/3),i=xe(S,w,s),o=xe(S,w,s-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${o=Math.round(255*o)},${t[4]?parseFloat(t[4]):1})`}}}function xe(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 qt(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function Io(e,t,n){const i=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function ke(e){let t=e.toLowerCase();if(qt(e)){if(t.length===4){let i="#";for(let o=1;o<4;o+=1)i+=t.slice(o,o+1).concat(t.slice(o,o+1));t=i}const n=[];for(let i=1;i<7;i+=2)n.push(parseInt("0x"+t.slice(i,i+2)));return"RGB("+n.join(",")+")"}return t}function _o(e){if(!qt(e))return;const[t,n,i]=ke(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(o=>Number(o));return .299*t+.578*n+.114*i<192}function Mo(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${ze(e.substring(0,2),t)}${ze(e.substring(2,4),t)}${ze(e.substring(4,6),t)}`}function Lo(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Ee(e.substring(0,2),t)}${Ee(e.substring(2,4),t)}${Ee(e.substring(4,6),t)}`}function Ee(e,t){const n=parseInt(e,16)+t,i=n>255?255:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Ln(e,t,n){const i=[e,t,n].map(o=>(o/=255)<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Ro(e){return function(t,n){return(Ln(~~t[0],~~t[1],~~t[2])+.05)/(Ln(n[0],n[1],n[2])+.05)}(ke(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function ze(e,t){const n=parseInt(e,16)-t,i=n<0?0:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Ie(e){return{all:e=e||new Map,on(t,n){const i=e?.get(t);i&&i.push(n)||e?.set(t,[n])},off(t,n){const i=e?.get(t);i&&i.splice(i.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(i=>{i(n)}),(e?.get("*")||[]).slice().map(i=>{i(t,n)})}}}(function(e){e[e.RGBA=0]="RGBA",e[e.Hex=1]="Hex",e[e.Hsla=2]="Hsla"})(wt||(wt={}));const It=Ie(),K={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},Gt=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const i=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(i),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Do(e,t){const n=window.URL||window.webkitURL||window,i=new Blob([e]),o=document.createElement("a");o.href=n.createObjectURL(i),o.download=t,o.click(),n.revokeObjectURL(o.href)}const Rn=(e,t)=>{const n=JSON.stringify(e,null,2);t?Gt(n,t+".json"):It.emit(K.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Po=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(i){Gt(i.data,n)}).catch(i=>{console.warn(i),It.emit(K.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Dn(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function To({url:e,target:t="_blank",fileName:n}){const i=new URL(e).host==location.host;return new Promise((o,s)=>{if(i){const g=document.createElement("a");if(g.href=e,g.target=t,g.download!==void 0&&(g.download=n||Dn(e)),document.createEvent){const y=document.createEvent("MouseEvents");return y.initEvent("click",!0,!0),g.dispatchEvent(y),o(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),o(!0)}{const g=document.createElement("canvas"),y=document.createElement("img");y.setAttribute("crossOrigin","Anonymous"),y.src=e,y.onload=w=>{g.width=y.width,g.height=y.height,g.getContext("2d").drawImage(y,0,0,y.width,y.height),g.toBlob(S=>{if(S){const k=document.createElement("a");k.href=window.URL.createObjectURL(S),k.download=Dn(e),k.click(),URL.revokeObjectURL(k.href),o(!0)}},"image/jpeg")},y.onerror=w=>s(w)}})}function Ao(e){for(var t=new Date().getTime();new Date().getTime()-t<e;);console.log(`\u5F3A\u5236\u7B49\u5F85${e}\u6BEB\u79D2`)}const M={Config:SysConfig,EventBus:It,DefaultProxyClient:null,Axios:mo},Pn="access_token",pt=new $t("user",localStorage);function bt(){return pt.get(Pn)}function _e(){pt.remove(Pn),M.User&&delete M.User}function Tn(){return bt()?.refresh}function Me(e,t,n,i="json",o){const s={baseURL:M.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,headers:{"Content-Type":"application/json",Authorization:"bearer "+bt()?.token},responseType:i,cancelToken:o};if(n)for(let g in n)s.headers[g]=n[g];return M.SystemID&&(s.headers.sysid=M.SystemID,M.SystemGroup&&(s.headers.sysgroup=M.SystemGroup)),t&&(s.baseURL=t),s}function at(e,t,n,i,o="json",s,g){const y=Me(n,t,i,o,s);return g&&g>=2e4&&(y.timeout=g),M.Axios?.get(e,y).catch(function(w){Xt(w,t,e,"Get")})}function Xt(e,t,n,i="Get"){const o=`${t}${n}`;if(e&&e.response){let s=!1;const g=e.response.status;switch(g){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 w=e.response.data;if(w){const S=w.indexOf(":"),k=w.indexOf(`\r
2
+ `);if(S>0&&k-S>2){const z=w.substring(S+2,k);z.indexOf("'System.Exception'")>0?e.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(s=!0,e.message=z)}}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 y={address:o,code:g,isExceptionInfo:s,message:e.message,result:e.response.data};if(console.warn(`HTTP ${i}\u8BF7\u6C42\u9519\u8BEF\uFF1A`,y),M.EventBus.emit(K.AxiosRequestErrorEvent,y),s)throw new Error(e.message)}}function Le(e,t,n,i,o,s="json",g){const y=Me(i,t,o,s);g&&g>=2e4&&(y.timeout=g);const w=function(S){let k=new FormData;return S&&Object.keys(S).forEach(z=>{if(!S)return;let B=S[z];B!=null&&k.append(z,function(A){return A instanceof Blob?A:A.toString()}(B))}),k}(n);return M.Axios?.post(e,w,y).catch(function(S){Xt(S,t,e,"Post")})}function Bo(e,t,n,i,o,s="json",g){const y=Me(i,t,o,s);return g&&g>=2e4&&(y.timeout=g),M.Axios?.post(e,n,y).catch(function(w){Xt(w,t,e,"Post")})}function No(e,t){return at(e,void 0,t)}function Uo(e,t){return Le(e,void 0,t)}function Oo(e,t){return M.Axios?.get(e,{params:t}).catch(function(n){Xt(n,e,"","\u5916\u90E8Get")})}var Re={exports:{}},jo=typeof window<"u"?window:zt!==void 0?zt:typeof self<"u"?self:{},Wo=function(e){if(!e)return!1;var t=Fo.call(e);return t==="[object Function]"||typeof e=="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Fo=Object.prototype.toString,De=function(e){return e.replace(/^\s+|\s+$/g,"")},$o=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)Ho.call(n,i)&&(e[i]=n[i])}return e},Ho=Object.prototype.hasOwnProperty,An=jo,qo=Wo,Go=function(e){if(!e)return{};for(var t,n={},i=De(e).split(`
3
+ `),o=0;o<i.length;o++){var s=i[o],g=s.indexOf(":"),y=De(s.slice(0,g)).toLowerCase(),w=De(s.slice(g+1));n[y]===void 0?n[y]=w:(t=n[y],Object.prototype.toString.call(t)==="[object Array]"?n[y].push(w):n[y]=[n[y],w])}return n},Xo=$o;function Bn(e,t,n){var i=e;return qo(t)?(n=t,typeof e=="string"&&(i={uri:e})):i=Xo(t,{uri:e}),i.callback=n,i}function ut(e,t,n){return Nn(t=Bn(e,t,n))}function Nn(e){if(e.callback===void 0)throw new Error("callback argument missing");var t=!1,n=function(d,h,l){t||(t=!0,e.callback(d,h,l))};function i(){var d=void 0;if(d=w.response?w.response:w.responseText||function(h){try{if(h.responseType==="document")return h.responseXML;var l=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!l)return h.responseXML}catch{}return null}(w),b)try{d=JSON.parse(d)}catch{}return d}function o(d){return clearTimeout(S),d instanceof Error||(d=new Error(""+(d||"Unknown XMLHttpRequest Error"))),d.statusCode=0,n(d,u)}function s(){if(!y){var d;clearTimeout(S),d=e.useXDR&&w.status===void 0?200:w.status===1223?204:w.status;var h=u,l=null;return d!==0?(h={body:i(),statusCode:d,method:z,headers:{},url:k,rawRequest:w},w.getAllResponseHeaders&&(h.headers=Go(w.getAllResponseHeaders()))):l=new Error("Internal XMLHttpRequest Error"),n(l,h,h.body)}}var g,y,w=e.xhr||null;w||(w=e.cors||e.useXDR?new ut.XDomainRequest:new ut.XMLHttpRequest);var S,k=w.url=e.uri||e.url,z=w.method=e.method||"GET",B=e.body||e.data,A=w.headers=e.headers||{},D=!!e.sync,b=!1,u={body:void 0,headers:{},statusCode:0,method:z,url:k,rawRequest:w};if("json"in e&&e.json!==!1&&(b=!0,A.accept||A.Accept||(A.Accept="application/json"),z!=="GET"&&z!=="HEAD"&&(A["content-type"]||A["Content-Type"]||(A["Content-Type"]="application/json"),B=JSON.stringify(e.json===!0?B:e.json))),w.onreadystatechange=function(){w.readyState===4&&setTimeout(s,0)},w.onload=s,w.onerror=o,w.onprogress=function(){},w.onabort=function(){y=!0},w.ontimeout=o,w.open(z,k,!D,e.username,e.password),D||(w.withCredentials=!!e.withCredentials),!D&&e.timeout>0&&(S=setTimeout(function(){if(!y){y=!0,w.abort("timeout");var d=new Error("XMLHttpRequest timeout");d.code="ETIMEDOUT",o(d)}},e.timeout)),w.setRequestHeader)for(g in A)A.hasOwnProperty(g)&&w.setRequestHeader(g,A[g]);else if(e.headers&&!function(d){for(var h in d)if(d.hasOwnProperty(h))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(w.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(w),w.send(B||null),w}Re.exports=ut,Re.exports.default=ut,ut.XMLHttpRequest=An.XMLHttpRequest||function(){},ut.XDomainRequest="withCredentials"in new ut.XMLHttpRequest?ut.XMLHttpRequest:An.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){ut[e==="delete"?"del":e]=function(t,n,i){return(n=Bn(t,n,i)).method=e.toUpperCase(),Nn(n)}});const Vo=[200,201,202,204,308],Ko=[408,502,503,504];class Yo{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=Ie(),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,i=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(i,i+n))})}xhrPromise(t){const n=i=>{i.upload.onprogress=o=>{const s=100/this.totalChunks,g=s*this.file.size,y=s*this.chunkCount,w=o.loaded/(o.total??g)*s;this.dispatch("progress",Math.min(y+w,100))}};return new Promise((i,o)=>{this.currentXhr=Re.exports({...t,beforeSend:n},(s,g)=>(this.currentXhr=void 0,s?o(s):i(g)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,i={...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:i,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(){this.paused||this.offline||this.success||this.getChunk().then(()=>this.sendChunk()).then(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Vo.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=100*(this.chunkCount/this.totalChunks*this.file.size)/this.file.size;this.dispatch("progress",n)}else if(t!=null&&Ko.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;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 Jo=e=>new Yo(e),Zo=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 At{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!Ft.isNullOrEmpty(t)){if(At.httpTransport||(At.httpTransport=new vo),this.client=new go(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")):It.emit(K.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,i){if(this.client)return await this.client.invoke(t,n,i)}encode(t,n,i){if(this.client)return this.client.codec.encode(t,n,i)}decode(t,n){if(this.client)return this.client.codec.decode(t,n)}}class Rt{hproseClient;hpProxyObj;defaultContext=new be;constructor(t){this.hproseClient=new At(t),this.hpProxyObj=null}getClientContext(t,n){const i={};n&&(i.requestHeaders=n);const o=bt();i.httpRequestHeaders=t||{};const s=i.httpRequestHeaders;return o&&(s.token=o.token),M.SystemID&&(s.sysid=M.SystemID,M.SystemGroup&&(s.sysgroup=M.SystemGroup)),new be(i)}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||It.emit(K.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,i){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,i)}async hproseInvokeContext(t,n,...i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const o=bt();return console.log(o,"userToken3"),o&&(n||(n=new be({httpRequestHeaders:{token:o.token}}))),await this.hproseClient.invoke(t,i,n)}async hproseInvokeEncode(t){const n=new _n(t).toBytes(),i=await this.hproseClient.client?.request(n,this.defaultContext);return i&&this.hproseClient.client?.codec.decode(i,this.defaultContext)}encodeRequest(t,...n){const i=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return _n.toString(i)}}class Qo{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,i="success"){if(this.message)if(typeof this.message=="function")this.message({type:i,message:t,duration:n});else switch(i){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn(t,n);break;case"error":this.message.error(t,n)}else{switch(i){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":i="dark",console.error(t)}this.eventBus&&this.eventBus.emit(K.AlertInfoEvent,{type:i,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")}}const Pe=new Map,tr=function(e,t,n){!M.Config.DefaultHproseAPI&&M.Config.ServiceURL&&(M.Config.DefaultHproseAPI=M.Config.ServiceURL.DefaultHproseAPI),M.Config.DefaultHproseAPI&&Ft.isNotEmpty(M.Config.DefaultHproseAPI)&&(M.DefaultProxyClient=new Rt(M.Config.DefaultHproseAPI));const i=M.Config.UI.GrayMode;i&&ot.setGrayMode(i);const o=new Qo(e,M.EventBus);M.Message=o,M.SystemID=t,M.SystemGroup=n,M.EventBus.on(K.HproseServiceErrorEvent,s=>{const g=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${s}`;o.warn(g)}),M.EventBus.on(K.WebAPIErrorEvent,s=>{const g=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${s}`;o.warn(g)}),M.EventBus.on(K.CommonWarnEvent,s=>{o.warn(s)})};function Un(e){if(e&&Ft.isNotEmpty(e)){if(Pe.has(e))return Pe.get(e);{const t=new Rt(e);return Pe.set(e,t),t}}}function er(e){const t=Un(e);return t&&(M.DefaultProxyClient=t),t}const Te="is_LockScreen",On=pt.get(Te,!1),Dt={isLock:On,lockTime:On=="true"?Wn():0};function jn(e){Dt.isLock=e,pt.set(Te,e,10),e&&(_e(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function nr(){return pt.get(Te,!1)}function Wn(){let e=3600;return M.Config.UI?.LockTime&&M.Config.UI?.LockTime>=10&&(e=M.Config.UI.LockTime),e}let Ae;function Be(){clearInterval(Ae),!(window.location.href.indexOf("/login")>0||Dt.isLock)&&(jn(!1),Dt.lockTime=Wn(),Ae=setInterval(()=>{if(Dt.lockTime--,Dt.lockTime<=0)return jn(!0),clearInterval(Ae)},1e3))}function ir(){Be(),document.addEventListener("mousedown",Be)}function or(){document.removeEventListener("mousedown",Be)}function Ne(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 rr={exports:{}},Vt=rr.exports=function e(t,n,i){function o(y,w){if(!n[y]){if(!t[y]){if(!w&&Ne)return Ne(y);if(s)return s(y,!0);var S=new Error("Cannot find module '"+y+"'");throw S.code="MODULE_NOT_FOUND",S}var k=n[y]={exports:{}};t[y][0].call(k.exports,function(z){var B=t[y][1][z];return o(B||z)},k,k.exports,e,t,n,i)}return n[y].exports}for(var s=Ne,g=0;g<i.length;g++)o(i[g]);return o}({1:[function(e,t,n){(function(i){var o,s,g=i.MutationObserver||i.WebKitMutationObserver;if(g){var y=0,w=new g(B),S=i.document.createTextNode("");w.observe(S,{characterData:!0}),o=function(){S.data=y=++y%2}}else if(i.setImmediate||i.MessageChannel===void 0)o="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var D=i.document.createElement("script");D.onreadystatechange=function(){B(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},i.document.documentElement.appendChild(D)}:function(){setTimeout(B,0)};else{var k=new i.MessageChannel;k.port1.onmessage=B,o=function(){k.port2.postMessage(0)}}var z=[];function B(){var D,b;s=!0;for(var u=z.length;u;){for(b=z,z=[],D=-1;++D<u;)b[D]();u=z.length}s=!1}function A(D){z.push(D)!==1||s||o()}t.exports=A}).call(this,zt!==void 0?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var i=e(1);function o(){}var s={},g=["REJECTED"],y=["FULFILLED"],w=["PENDING"];function S(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=w,this.queue=[],this.outcome=void 0,l!==o&&A(this,l)}function k(l,p,P){this.promise=l,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof P=="function"&&(this.onRejected=P,this.callRejected=this.otherCallRejected)}function z(l,p,P){i(function(){var L;try{L=p(P)}catch(R){return s.reject(l,R)}L===l?s.reject(l,new TypeError("Cannot resolve promise with itself")):s.resolve(l,L)})}function B(l){var p=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof p=="function")return function(){p.apply(l,arguments)}}function A(l,p){var P=!1;function L(O){P||(P=!0,s.reject(l,O))}function R(O){P||(P=!0,s.resolve(l,O))}function U(){p(R,L)}var j=D(U);j.status==="error"&&L(j.value)}function D(l,p){var P={};try{P.value=l(p),P.status="success"}catch(L){P.status="error",P.value=L}return P}function b(l){return l instanceof this?l:s.resolve(new this(o),l)}function u(l){var p=new this(o);return s.reject(p,l)}function d(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=l.length,L=!1;if(!P)return this.resolve([]);for(var R=new Array(P),U=0,j=-1,O=new this(o);++j<P;)$(l[j],j);return O;function $(tt,X){function Y(G){R[X]=G,++U!==P||L||(L=!0,s.resolve(O,R))}p.resolve(tt).then(Y,function(G){L||(L=!0,s.reject(O,G))})}}function h(l){var p=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=l.length,L=!1;if(!P)return this.resolve([]);for(var R=-1,U=new this(o);++R<P;)j(l[R]);return U;function j(O){p.resolve(O).then(function($){L||(L=!0,s.resolve(U,$))},function($){L||(L=!0,s.reject(U,$))})}}t.exports=S,S.prototype.catch=function(l){return this.then(null,l)},S.prototype.then=function(l,p){if(typeof l!="function"&&this.state===y||typeof p!="function"&&this.state===g)return this;var P=new this.constructor(o);return this.state!==w?z(P,this.state===y?l:p,this.outcome):this.queue.push(new k(P,l,p)),P},k.prototype.callFulfilled=function(l){s.resolve(this.promise,l)},k.prototype.otherCallFulfilled=function(l){z(this.promise,this.onFulfilled,l)},k.prototype.callRejected=function(l){s.reject(this.promise,l)},k.prototype.otherCallRejected=function(l){z(this.promise,this.onRejected,l)},s.resolve=function(l,p){var P=D(B,p);if(P.status==="error")return s.reject(l,P.value);var L=P.value;if(L)A(l,L);else{l.state=y,l.outcome=p;for(var R=-1,U=l.queue.length;++R<U;)l.queue[R].callFulfilled(p)}return l},s.reject=function(l,p){l.state=g,l.outcome=p;for(var P=-1,L=l.queue.length;++P<L;)l.queue[P].callRejected(p);return l},S.resolve=b,S.reject=u,S.all=d,S.race=h},{1:1}],3:[function(e,t,n){(function(i){typeof i.Promise!="function"&&(i.Promise=e(2))}).call(this,zt!==void 0?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function o(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function s(){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 g=s();function y(){try{if(!g||!g.open)return!1;var r=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function w(r,a){r=r||[],a=a||{};try{return new Blob(r,a)}catch(f){if(f.name!=="TypeError")throw f;for(var c=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),m=0;m<r.length;m+=1)c.append(r[m]);return c.getBlob(a.type)}}typeof Promise>"u"&&e(3);var S=Promise;function k(r,a){a&&r.then(function(c){a(null,c)},function(c){a(c)})}function z(r,a,c){typeof a=="function"&&r.then(a),typeof c=="function"&&r.catch(c)}function B(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var D="local-forage-detect-blob-support",b=void 0,u={},d=Object.prototype.toString,h="readonly",l="readwrite";function p(r){for(var a=r.length,c=new ArrayBuffer(a),m=new Uint8Array(c),f=0;f<a;f++)m[f]=r.charCodeAt(f);return c}function P(r){return new S(function(a){var c=r.transaction(D,l),m=w([""]);c.objectStore(D).put(m,"key"),c.onabort=function(f){f.preventDefault(),f.stopPropagation(),a(!1)},c.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);a(v||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function L(r){return typeof b=="boolean"?S.resolve(b):P(r).then(function(a){return b=a})}function R(r){var a=u[r.name],c={};c.promise=new S(function(m,f){c.resolve=m,c.reject=f}),a.deferredOperations.push(c),a.dbReady?a.dbReady=a.dbReady.then(function(){return c.promise}):a.dbReady=c.promise}function U(r){var a=u[r.name].deferredOperations.pop();if(a)return a.resolve(),a.promise}function j(r,a){var c=u[r.name].deferredOperations.pop();if(c)return c.reject(a),c.promise}function O(r,a){return new S(function(c,m){if(u[r.name]=u[r.name]||Qe(),r.db){if(!a)return c(r.db);R(r),r.db.close()}var f=[r.name];a&&f.push(r.version);var v=g.open.apply(g,f);a&&(v.onupgradeneeded=function(C){var x=v.result;try{x.createObjectStore(r.storeName),C.oldVersion<=1&&x.createObjectStore(D)}catch(E){if(E.name!=="ConstraintError")throw E;console.warn('The database "'+r.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+r.storeName+'" already exists.')}}),v.onerror=function(C){C.preventDefault(),m(v.error)},v.onsuccess=function(){var C=v.result;C.onversionchange=function(x){x.target.close()},c(C),U(r)}})}function $(r){return O(r,!1)}function tt(r){return O(r,!0)}function X(r,a){if(!r.db)return!0;var c=!r.db.objectStoreNames.contains(r.storeName),m=r.version<r.db.version,f=r.version>r.db.version;if(m&&(r.version!==a&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||c){if(c){var v=r.db.version+1;v>r.version&&(r.version=v)}return!0}return!1}function Y(r){return new S(function(a,c){var m=new FileReader;m.onerror=c,m.onloadend=function(f){var v=btoa(f.target.result||"");a({__local_forage_encoded_blob:!0,data:v,type:r.type})},m.readAsBinaryString(r)})}function G(r){return w([p(atob(r.data))],{type:r.type})}function rt(r){return r&&r.__local_forage_encoded_blob}function Bt(r){var a=this,c=a._initReady().then(function(){var m=u[a._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return z(c,r,r),c}function he(r){R(r);for(var a=u[r.name],c=a.forages,m=0;m<c.length;m++){var f=c[m];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,$(r).then(function(v){return r.db=v,X(r)?tt(r):v}).then(function(v){r.db=a.db=v;for(var C=0;C<c.length;C++)c[C]._dbInfo.db=v}).catch(function(v){throw j(r,v),v})}function it(r,a,c,m){m===void 0&&(m=1);try{var f=r.db.transaction(r.storeName,a);c(null,f)}catch(v){if(m>0&&(!r.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return S.resolve().then(function(){if(!r.db||v.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),tt(r)}).then(function(){return he(r).then(function(){it(r,a,c,m-1)})}).catch(c);c(v)}}function Qe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function li(r){var a=this,c={db:null};if(r)for(var m in r)c[m]=r[m];var f=u[c.name];f||(f=Qe(),u[c.name]=f),f.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=Bt);var v=[];function C(){return S.resolve()}for(var x=0;x<f.forages.length;x++){var E=f.forages[x];E!==a&&v.push(E._initReady().catch(C))}var I=f.forages.slice(0);return S.all(v).then(function(){return c.db=f.db,$(c)}).then(function(_){return c.db=_,X(c,a._defaultConfig.version)?tt(c):_}).then(function(_){c.db=f.db=_,a._dbInfo=c;for(var T=0;T<I.length;T++){var N=I[T];N!==a&&(N._dbInfo.db=c.db,N._dbInfo.version=c.version)}})}function hi(r,a){var c=this;r=B(r);var m=new S(function(f,v){c.ready().then(function(){it(c._dbInfo,h,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName).get(r);E.onsuccess=function(){var I=E.result;I===void 0&&(I=null),rt(I)&&(I=G(I)),f(I)},E.onerror=function(){v(E.error)}}catch(I){v(I)}})}).catch(v)});return k(m,a),m}function di(r,a){var c=this,m=new S(function(f,v){c.ready().then(function(){it(c._dbInfo,h,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName).openCursor(),I=1;E.onsuccess=function(){var _=E.result;if(_){var T=_.value;rt(T)&&(T=G(T));var N=r(T,_.key,I++);N!==void 0?f(N):_.continue()}else f()},E.onerror=function(){v(E.error)}}catch(_){v(_)}})}).catch(v)});return k(m,a),m}function fi(r,a,c){var m=this;r=B(r);var f=new S(function(v,C){var x;m.ready().then(function(){return x=m._dbInfo,d.call(a)==="[object Blob]"?L(x.db).then(function(E){return E?a:Y(a)}):a}).then(function(E){it(m._dbInfo,l,function(I,_){if(I)return C(I);try{var T=_.objectStore(m._dbInfo.storeName);E===null&&(E=void 0);var N=T.put(E,r);_.oncomplete=function(){E===void 0&&(E=null),v(E)},_.onabort=_.onerror=function(){var W=N.error?N.error:N.transaction.error;C(W)}}catch(W){C(W)}})}).catch(C)});return k(f,c),f}function pi(r,a){var c=this;r=B(r);var m=new S(function(f,v){c.ready().then(function(){it(c._dbInfo,l,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName).delete(r);x.oncomplete=function(){f()},x.onerror=function(){v(E.error)},x.onabort=function(){var I=E.error?E.error:E.transaction.error;v(I)}}catch(I){v(I)}})}).catch(v)});return k(m,a),m}function mi(r){var a=this,c=new S(function(m,f){a.ready().then(function(){it(a._dbInfo,l,function(v,C){if(v)return f(v);try{var x=C.objectStore(a._dbInfo.storeName).clear();C.oncomplete=function(){m()},C.onabort=C.onerror=function(){var E=x.error?x.error:x.transaction.error;f(E)}}catch(E){f(E)}})}).catch(f)});return k(c,r),c}function gi(r){var a=this,c=new S(function(m,f){a.ready().then(function(){it(a._dbInfo,h,function(v,C){if(v)return f(v);try{var x=C.objectStore(a._dbInfo.storeName).count();x.onsuccess=function(){m(x.result)},x.onerror=function(){f(x.error)}}catch(E){f(E)}})}).catch(f)});return k(c,r),c}function vi(r,a){var c=this,m=new S(function(f,v){r<0?f(null):c.ready().then(function(){it(c._dbInfo,h,function(C,x){if(C)return v(C);try{var E=x.objectStore(c._dbInfo.storeName),I=!1,_=E.openKeyCursor();_.onsuccess=function(){var T=_.result;T?r===0||I?f(T.key):(I=!0,T.advance(r)):f(null)},_.onerror=function(){v(_.error)}}catch(T){v(T)}})}).catch(v)});return k(m,a),m}function yi(r){var a=this,c=new S(function(m,f){a.ready().then(function(){it(a._dbInfo,h,function(v,C){if(v)return f(v);try{var x=C.objectStore(a._dbInfo.storeName).openKeyCursor(),E=[];x.onsuccess=function(){var I=x.result;I?(E.push(I.key),I.continue()):m(E)},x.onerror=function(){f(x.error)}}catch(I){f(I)}})}).catch(f)});return k(c,r),c}function wi(r,a){a=A.apply(this,arguments);var c=this.config();(r=typeof r!="function"&&r||{}).name||(r.name=r.name||c.name,r.storeName=r.storeName||c.storeName);var m,f=this;if(r.name){var v=r.name===c.name&&f._dbInfo.db?S.resolve(f._dbInfo.db):$(r).then(function(C){var x=u[r.name],E=x.forages;x.db=C;for(var I=0;I<E.length;I++)E[I]._dbInfo.db=C;return C});m=r.storeName?v.then(function(C){if(C.objectStoreNames.contains(r.storeName)){var x=C.version+1;R(r);var E=u[r.name],I=E.forages;C.close();for(var _=0;_<I.length;_++){var T=I[_];T._dbInfo.db=null,T._dbInfo.version=x}return new S(function(N,W){var F=g.open(r.name,x);F.onerror=function(st){F.result.close(),W(st)},F.onupgradeneeded=function(){F.result.deleteObjectStore(r.storeName)},F.onsuccess=function(){var st=F.result;st.close(),N(st)}}).then(function(N){E.db=N;for(var W=0;W<I.length;W++){var F=I[W];F._dbInfo.db=N,U(F._dbInfo)}}).catch(function(N){throw(j(r,N)||S.resolve()).catch(function(){}),N})}}):v.then(function(C){R(r);var x=u[r.name],E=x.forages;C.close();for(var I=0;I<E.length;I++)E[I]._dbInfo.db=null;return new S(function(_,T){var N=g.deleteDatabase(r.name);N.onerror=function(){var W=N.result;W&&W.close(),T(N.error)},N.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},N.onsuccess=function(){var W=N.result;W&&W.close(),_(W)}}).then(function(_){x.db=_;for(var T=0;T<E.length;T++)U(E[T]._dbInfo)}).catch(function(_){throw(j(r,_)||S.resolve()).catch(function(){}),_})})}else m=S.reject("Invalid arguments");return k(m,a),m}var bi={_driver:"asyncStorage",_initStorage:li,_support:y(),iterate:di,getItem:hi,setItem:fi,removeItem:pi,clear:mi,length:gi,key:vi,keys:yi,dropInstance:wi};function Si(){return typeof openDatabase=="function"}var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci="~~local_forage_type~",tn=/^~~local_forage_type~([^~]+)~/,Nt="__lfsc__:",de=Nt.length,fe="arbf",pe="blob",en="si08",nn="ui08",on="uic8",rn="si16",sn="si32",an="ur16",cn="ui32",un="fl32",ln="fl64",hn=de+fe.length,dn=Object.prototype.toString;function fn(r){var a,c,m,f,v,C=.75*r.length,x=r.length,E=0;r[r.length-1]==="="&&(C--,r[r.length-2]==="="&&C--);var I=new ArrayBuffer(C),_=new Uint8Array(I);for(a=0;a<x;a+=4)c=lt.indexOf(r[a]),m=lt.indexOf(r[a+1]),f=lt.indexOf(r[a+2]),v=lt.indexOf(r[a+3]),_[E++]=c<<2|m>>4,_[E++]=(15&m)<<4|f>>2,_[E++]=(3&f)<<6|63&v;return I}function me(r){var a,c=new Uint8Array(r),m="";for(a=0;a<c.length;a+=3)m+=lt[c[a]>>2],m+=lt[(3&c[a])<<4|c[a+1]>>4],m+=lt[(15&c[a+1])<<2|c[a+2]>>6],m+=lt[63&c[a+2]];return c.length%3==2?m=m.substring(0,m.length-1)+"=":c.length%3==1&&(m=m.substring(0,m.length-2)+"=="),m}function xi(r,a){var c="";if(r&&(c=dn.call(r)),r&&(c==="[object ArrayBuffer]"||r.buffer&&dn.call(r.buffer)==="[object ArrayBuffer]")){var m,f=Nt;r instanceof ArrayBuffer?(m=r,f+=fe):(m=r.buffer,c==="[object Int8Array]"?f+=en:c==="[object Uint8Array]"?f+=nn:c==="[object Uint8ClampedArray]"?f+=on:c==="[object Int16Array]"?f+=rn:c==="[object Uint16Array]"?f+=an:c==="[object Int32Array]"?f+=sn:c==="[object Uint32Array]"?f+=cn:c==="[object Float32Array]"?f+=un:c==="[object Float64Array]"?f+=ln:a(new Error("Failed to get type for BinaryArray"))),a(f+me(m))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var C=Ci+r.type+"~"+me(this.result);a(Nt+pe+C)},v.readAsArrayBuffer(r)}else try{a(JSON.stringify(r))}catch(C){console.error("Couldn't convert value into a JSON string: ",r),a(null,C)}}function ki(r){if(r.substring(0,de)!==Nt)return JSON.parse(r);var a,c=r.substring(hn),m=r.substring(de,hn);if(m===pe&&tn.test(c)){var f=c.match(tn);a=f[1],c=c.substring(f[0].length)}var v=fn(c);switch(m){case fe:return v;case pe:return w([v],{type:a});case en:return new Int8Array(v);case nn:return new Uint8Array(v);case on:return new Uint8ClampedArray(v);case rn:return new Int16Array(v);case an:return new Uint16Array(v);case sn:return new Int32Array(v);case cn:return new Uint32Array(v);case un:return new Float32Array(v);case ln:return new Float64Array(v);default:throw new Error("Unkown type: "+m)}}var ge={serialize:xi,deserialize:ki,stringToBuffer:fn,bufferToString:me};function pn(r,a,c,m){r.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,m)}function Ei(r){var a=this,c={db:null};if(r)for(var m in r)c[m]=typeof r[m]!="string"?r[m].toString():r[m];var f=new S(function(v,C){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(x){return C(x)}c.db.transaction(function(x){pn(x,c,function(){a._dbInfo=c,v()},function(E,I){C(I)})},C)});return c.serializer=ge,f}function ht(r,a,c,m,f,v){r.executeSql(c,m,f,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(E,I){I.rows.length?v(E,x):pn(E,a,function(){E.executeSql(c,m,f,v)},v)},v):v(C,x)},v)}function zi(r,a){var c=this;r=B(r);var m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){ht(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[r],function(E,I){var _=I.rows.length?I.rows.item(0).value:null;_&&(_=C.serializer.deserialize(_)),f(_)},function(E,I){v(I)})})}).catch(v)});return k(m,a),m}function Ii(r,a){var c=this,m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){ht(x,C,"SELECT * FROM "+C.storeName,[],function(E,I){for(var _=I.rows,T=_.length,N=0;N<T;N++){var W=_.item(N),F=W.value;if(F&&(F=C.serializer.deserialize(F)),(F=r(F,W.key,N+1))!==void 0)return void f(F)}f()},function(E,I){v(I)})})}).catch(v)});return k(m,a),m}function mn(r,a,c,m){var f=this;r=B(r);var v=new S(function(C,x){f.ready().then(function(){a===void 0&&(a=null);var E=a,I=f._dbInfo;I.serializer.serialize(a,function(_,T){T?x(T):I.db.transaction(function(N){ht(N,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[r,_],function(){C(E)},function(W,F){x(F)})},function(N){if(N.code===N.QUOTA_ERR){if(m>0)return void C(mn.apply(f,[r,E,c,m-1]));x(N)}})})}).catch(x)});return k(v,c),v}function _i(r,a,c){return mn.apply(this,[r,a,c,1])}function Mi(r,a){var c=this;r=B(r);var m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){ht(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[r],function(){f()},function(E,I){v(I)})})}).catch(v)});return k(m,a),m}function Li(r){var a=this,c=new S(function(m,f){a.ready().then(function(){var v=a._dbInfo;v.db.transaction(function(C){ht(C,v,"DELETE FROM "+v.storeName,[],function(){m()},function(x,E){f(E)})})}).catch(f)});return k(c,r),c}function Ri(r){var a=this,c=new S(function(m,f){a.ready().then(function(){var v=a._dbInfo;v.db.transaction(function(C){ht(C,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(x,E){var I=E.rows.item(0).c;m(I)},function(x,E){f(E)})})}).catch(f)});return k(c,r),c}function Di(r,a){var c=this,m=new S(function(f,v){c.ready().then(function(){var C=c._dbInfo;C.db.transaction(function(x){ht(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[r+1],function(E,I){var _=I.rows.length?I.rows.item(0).key:null;f(_)},function(E,I){v(I)})})}).catch(v)});return k(m,a),m}function Pi(r){var a=this,c=new S(function(m,f){a.ready().then(function(){var v=a._dbInfo;v.db.transaction(function(C){ht(C,v,"SELECT key FROM "+v.storeName,[],function(x,E){for(var I=[],_=0;_<E.rows.length;_++)I.push(E.rows.item(_).key);m(I)},function(x,E){f(E)})})}).catch(f)});return k(c,r),c}function Ti(r){return new S(function(a,c){r.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,v){for(var C=[],x=0;x<v.rows.length;x++)C.push(v.rows.item(x).name);a({db:r,storeNames:C})},function(f,v){c(v)})},function(m){c(m)})})}function Ai(r,a){a=A.apply(this,arguments);var c=this.config();(r=typeof r!="function"&&r||{}).name||(r.name=r.name||c.name,r.storeName=r.storeName||c.storeName);var m,f=this;return k(m=r.name?new S(function(v){var C;C=r.name===c.name?f._dbInfo.db:openDatabase(r.name,"","",0),r.storeName?v({db:C,storeNames:[r.storeName]}):v(Ti(C))}).then(function(v){return new S(function(C,x){v.db.transaction(function(E){function I(W){return new S(function(F,st){E.executeSql("DROP TABLE IF EXISTS "+W,[],function(){F()},function(wn,Mt){st(Mt)})})}for(var _=[],T=0,N=v.storeNames.length;T<N;T++)_.push(I(v.storeNames[T]));S.all(_).then(function(){C()}).catch(function(W){x(W)})},function(E){x(E)})})}):S.reject("Invalid arguments"),a),m}var Bi={_driver:"webSQLStorage",_initStorage:Ei,_support:Si(),iterate:Ii,getItem:zi,setItem:_i,removeItem:Mi,clear:Li,length:Ri,key:Di,keys:Pi,dropInstance:Ai};function Ni(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function gn(r,a){var c=r.name+"/";return r.storeName!==a.storeName&&(c+=r.storeName+"/"),c}function Ui(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function Oi(){return!Ui()||localStorage.length>0}function ji(r){var a=this,c={};if(r)for(var m in r)c[m]=r[m];return c.keyPrefix=gn(r,a._defaultConfig),Oi()?(a._dbInfo=c,c.serializer=ge,S.resolve()):S.reject()}function Wi(r){var a=this,c=a.ready().then(function(){for(var m=a._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var v=localStorage.key(f);v.indexOf(m)===0&&localStorage.removeItem(v)}});return k(c,r),c}function Fi(r,a){var c=this;r=B(r);var m=c.ready().then(function(){var f=c._dbInfo,v=localStorage.getItem(f.keyPrefix+r);return v&&(v=f.serializer.deserialize(v)),v});return k(m,a),m}function $i(r,a){var c=this,m=c.ready().then(function(){for(var f=c._dbInfo,v=f.keyPrefix,C=v.length,x=localStorage.length,E=1,I=0;I<x;I++){var _=localStorage.key(I);if(_.indexOf(v)===0){var T=localStorage.getItem(_);if(T&&(T=f.serializer.deserialize(T)),(T=r(T,_.substring(C),E++))!==void 0)return T}}});return k(m,a),m}function Hi(r,a){var c=this,m=c.ready().then(function(){var f,v=c._dbInfo;try{f=localStorage.key(r)}catch{f=null}return f&&(f=f.substring(v.keyPrefix.length)),f});return k(m,a),m}function qi(r){var a=this,c=a.ready().then(function(){for(var m=a._dbInfo,f=localStorage.length,v=[],C=0;C<f;C++){var x=localStorage.key(C);x.indexOf(m.keyPrefix)===0&&v.push(x.substring(m.keyPrefix.length))}return v});return k(c,r),c}function Gi(r){var a=this.keys().then(function(c){return c.length});return k(a,r),a}function Xi(r,a){var c=this;r=B(r);var m=c.ready().then(function(){var f=c._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return k(m,a),m}function Vi(r,a,c){var m=this;r=B(r);var f=m.ready().then(function(){a===void 0&&(a=null);var v=a;return new S(function(C,x){var E=m._dbInfo;E.serializer.serialize(a,function(I,_){if(_)x(_);else try{localStorage.setItem(E.keyPrefix+r,I),C(v)}catch(T){T.name!=="QuotaExceededError"&&T.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(T),x(T)}})})});return k(f,c),f}function Ki(r,a){if(a=A.apply(this,arguments),!(r=typeof r!="function"&&r||{}).name){var c=this.config();r.name=r.name||c.name,r.storeName=r.storeName||c.storeName}var m,f=this;return k(m=r.name?new S(function(v){r.storeName?v(gn(r,f._defaultConfig)):v(r.name+"/")}).then(function(v){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(v)===0&&localStorage.removeItem(x)}}):S.reject("Invalid arguments"),a),m}var Yi={_driver:"localStorageWrapper",_initStorage:ji,_support:Ni(),iterate:$i,getItem:Fi,setItem:Vi,removeItem:Xi,clear:Wi,length:Gi,key:Hi,keys:qi,dropInstance:Ki},Ji=function(r,a){return r===a||typeof r=="number"&&typeof a=="number"&&isNaN(r)&&isNaN(a)},Zi=function(r,a){for(var c=r.length,m=0;m<c;){if(Ji(r[m],a))return!0;m++}return!1},vn=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},_t={},yn={},xt={INDEXEDDB:bi,WEBSQL:Bi,LOCALSTORAGE:Yi},Qi=[xt.INDEXEDDB._driver,xt.WEBSQL._driver,xt.LOCALSTORAGE._driver],Ut=["dropInstance"],ve=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ut),to={description:"",driver:Qi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function eo(r,a){r[a]=function(){var c=arguments;return r.ready().then(function(){return r[a].apply(r,c)})}}function ye(){for(var r=1;r<arguments.length;r++){var a=arguments[r];if(a)for(var c in a)a.hasOwnProperty(c)&&(vn(a[c])?arguments[0][c]=a[c].slice():arguments[0][c]=a[c])}return arguments[0]}var no=new(function(){function r(a){for(var c in o(this,r),xt)if(xt.hasOwnProperty(c)){var m=xt[c],f=m._driver;this[c]=f,_t[f]||this.defineDriver(m)}this._defaultConfig=ye({},to),this._config=ye({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(a){if((a===void 0?"undefined":i(a))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var c in a){if(c==="storeName"&&(a[c]=a[c].replace(/\W/g,"_")),c==="version"&&typeof a[c]!="number")return new Error("Database version must be a number.");this._config[c]=a[c]}return!("driver"in a)||!a.driver||this.setDriver(this._config.driver)}return typeof a=="string"?this._config[a]:this._config},r.prototype.defineDriver=function(a,c,m){var f=new S(function(v,C){try{var x=a._driver,E=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void C(E);for(var I=ve.concat("_initStorage"),_=0,T=I.length;_<T;_++){var N=I[_];if((!Zi(Ut,N)||a[N])&&typeof a[N]!="function")return void C(E)}(function(){for(var F=function(io){return function(){var oo=new Error("Method "+io+" is not implemented by the current driver"),bn=S.reject(oo);return k(bn,arguments[arguments.length-1]),bn}},st=0,wn=Ut.length;st<wn;st++){var Mt=Ut[st];a[Mt]||(a[Mt]=F(Mt))}})();var W=function(F){_t[x]&&console.info("Redefining LocalForage driver: "+x),_t[x]=a,yn[x]=F,v()};"_support"in a?a._support&&typeof a._support=="function"?a._support().then(W,C):W(!!a._support):W(!0)}catch(F){C(F)}});return z(f,c,m),f},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(a,c,m){var f=_t[a]?S.resolve(_t[a]):S.reject(new Error("Driver not found."));return z(f,c,m),f},r.prototype.getSerializer=function(a){var c=S.resolve(ge);return z(c,a),c},r.prototype.ready=function(a){var c=this,m=c._driverSet.then(function(){return c._ready===null&&(c._ready=c._initDriver()),c._ready});return z(m,a,a),m},r.prototype.setDriver=function(a,c,m){var f=this;vn(a)||(a=[a]);var v=this._getSupportedDrivers(a);function C(){f._config.driver=f.driver()}function x(_){return f._extend(_),C(),f._ready=f._initStorage(f._config),f._ready}function E(_){return function(){var T=0;function N(){for(;T<_.length;){var W=_[T];return T++,f._dbInfo=null,f._ready=null,f.getDriver(W).then(x).catch(N)}C();var F=new Error("No available storage method found.");return f._driverSet=S.reject(F),f._driverSet}return N()}}var I=this._driverSet!==null?this._driverSet.catch(function(){return S.resolve()}):S.resolve();return this._driverSet=I.then(function(){var _=v[0];return f._dbInfo=null,f._ready=null,f.getDriver(_).then(function(T){f._driver=T._driver,C(),f._wrapLibraryMethodsWithReady(),f._initDriver=E(v)})}).catch(function(){C();var _=new Error("No available storage method found.");return f._driverSet=S.reject(_),f._driverSet}),z(this._driverSet,c,m),this._driverSet},r.prototype.supports=function(a){return!!yn[a]},r.prototype._extend=function(a){ye(this,a)},r.prototype._getSupportedDrivers=function(a){for(var c=[],m=0,f=a.length;m<f;m++){var v=a[m];this.supports(v)&&c.push(v)}return c},r.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,c=ve.length;a<c;a++)eo(this,ve[a])},r.prototype.createInstance=function(a){return new r(a)},r}());t.exports=no},{3:3}]},{},[4])(4),Fn={exports:{}};/*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */(function(e){Fn.exports=(()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,i=!1;const o=t.WebStreamsPolyfill||{},s=t.isSecureContext;let g=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const y=s||"MozAppearance"in document.documentElement.style?"iframe":"navigate",w={createWriteStream:function(k,z,B){let A={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},D=0,b=null,u=null,d=null;if(Number.isFinite(z)?([B,z]=[z,B],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),A.size=B,A.writableStrategy=z):z&&z.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),A.size=B,A.writableStrategy=z):A=z||{},!g){n||(n=s?S(w.mitm):function(P){const L="width=200,height=100",R=document.createDocumentFragment(),U={frame:t.open(P,"popup",L),loaded:!1,isIframe:!1,isPopup:!0,remove(){U.frame.close()},addEventListener(...O){R.addEventListener(...O)},dispatchEvent(...O){R.dispatchEvent(...O)},removeEventListener(...O){R.removeEventListener(...O)},postMessage(...O){U.frame.postMessage(...O)}},j=O=>{O.source===U.frame&&(U.loaded=!0,t.removeEventListener("message",j),U.dispatchEvent(new Event("load")))};return t.addEventListener("message",j),U}(w.mitm)),u=new MessageChannel,k=encodeURIComponent(k.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const l={transferringReadable:i,pathname:A.pathname||Math.random().toString().slice(-6)+"/"+k,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+k}};A.size&&(l.headers["Content-Length"]=A.size);const p=[l,"*",[u.port2]];if(i){const P=y==="iframe"?void 0:{transform(R,U){if(!(R instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");D+=R.length,U.enqueue(R),b&&(location.href=b,b=null)},flush(){b&&(location.href=b)}};d=new w.TransformStream(P,A.writableStrategy,A.readableStrategy);const L=d.readable;u.port1.postMessage({readableStream:L},[L])}u.port1.onmessage=P=>{P.data.download?y==="navigate"?(n.remove(),n=null,D?location.href=P.data.download:b=P.data.download):(n.isPopup&&(n.remove(),n=null,y==="iframe"&&S(w.mitm)),S(P.data.download)):P.data.abort&&(h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...p):n.addEventListener("load",()=>{n.postMessage(...p)},{once:!0})}let h=[];return!g&&d&&d.writable||new w.WritableStream({write(l){if(!(l instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");g?h.push(l):(u.port1.postMessage(l),D+=l.length,b&&(location.href=b,b=null))},close(){if(g){const l=new Blob(h,{type:"application/octet-stream; charset=utf-8"}),p=document.createElement("a");p.href=URL.createObjectURL(l),p.download=k,p.click()}else u.port1.postMessage("end")},abort(){h=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},A.writableStrategy)},WritableStream:t.WritableStream||o.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 S(k){if(!k)throw new Error("meh");const z=document.createElement("iframe");return z.hidden=!0,z.src=k,z.loaded=!1,z.name="iframe",z.isIframe=!0,z.postMessage=(...B)=>z.contentWindow.postMessage(...B),z.addEventListener("load",()=>{z.loaded=!0},{once:!0}),document.body.appendChild(z),z}try{new Response(new ReadableStream),s&&!("serviceWorker"in navigator)&&(g=!0)}catch{g=!0}return(k=>{try{k()}catch{}})(()=>{const{readable:k}=new TransformStream,z=new MessageChannel;z.port1.postMessage(k,[k]),z.port1.close(),z.port2.close(),i=!0,Object.defineProperty(w,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),w})()})();var sr=Fn.exports;class ar{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,i=3,o=6,s=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=Ie(),this.initIndexDB(),o>=3&&(this.cacheSize=o),s>this.requestTimeout&&(this.requestTimeout=s)}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="",i){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const o=await at(n,t,i);let s=null;return o&&o.status===200&&(s=o.data),s}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Vt.createInstance({name:this.fileID,driver:Vt.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(),Vt.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 i=t;if(!i&&this.downloadURL&&(i=this.downloadURL),!i)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const o=M.Axios.CancelToken;this.cancelSource=o.source(),this.isStarting=!0;const s={key:this.fileMetaData?.downloadID};let g=0;const y=this.cacheSize;let w=0;for(let S=0;S<this.totalChunks;S++){if(this.keys&&this.keys?.indexOf(S.toString())>=0){g++,g>this.finishNum&&(this.finishNum=g,this.downloadProgress());continue}const k=S*this.chunkByteSize;let z=k+this.chunkByteSize-1;this.fileMetaData&&z>this.fileMetaData.length&&(z=this.fileMetaData.length-1);const B={range:`bytes=${k}-${z}`};for(;w>=y;)await this.sleep(200);const A=S.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${S+1}/${this.totalChunks}`),w++,at(i,n,s,B,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async D=>{const b=D.data;w--,await this.currentDB?.setItem(A,b),g++,g>this.finishNum&&(this.finishNum=g,this.downloadProgress());const u=parseInt(A)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(D=>{w--;const b=parseInt(A)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${b}\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=sr.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const o=i.toString();let s=await this.currentDB?.getItem(o);if(s||(s=await this.currentDB?.getItem(o)),!s)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let g=new Response(s).body;if(g===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const y=g.getReader();for(;;){const{done:w,value:S}=await y.read();if(w)break;await t.write(S)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Vt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}const cr=Object.prototype.toString;function J(e,t){return cr.call(e)===`[object ${t}]`}function Kt(e){return J(e,"Function")}const $n=e=>typeof e<"u",Ue=e=>!$n(e);function Oe(e){return e===null}function ur(e){return Ue(e)&&Oe(e)}function lr(e){return Ue(e)||Oe(e)}const St=e=>e!==null&&J(e,"Object");function hr(e){return J(e,"Date")}function dr(e){return J(e,"Number")}function fr(e){return J(e,"AsyncFunction")}function pr(e){return J(e,"Promise")&&St(e)&&Kt(e.then)&&Kt(e.catch)}function Yt(e){return J(e,"String")}function mr(e){return e===!0||e===!1||J(e,"Boolean")}function Hn(e){return e&&Array.isArray(e)}const gr=()=>typeof window<"u",vr=e=>typeof window<"u"&&J(e,"Window"),yr=e=>St(e)&&!!e.tagName,wr=typeof window>"u";function br(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function Sr(e){return e==null||(Yt(e)||Hn(e)?e.length===0:!!St(e)&&JSON.stringify(e)==="{}")}function Cr(e){return J(e,"Error")}function xr(e){return J(e,"WeakSet")}function kr(e){return J(e,"WeakMap")}function Er(e){return J(e,"Symbol")}function zr(e){return J(e,"Map")}const Ir=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);function _r(e,t){let n="",i="";for(const o in t)n+=o+"="+encodeURIComponent(t[o])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,i}function qn(e={},t={}){let n;for(n in t)e[n]=St(e[n])?qn(e[n],t[n]):e[n]=t[n];return e}function Mr(e,t){const n=`${e}_${t}`;return ot.MD5(n)}function Gn(e){const t=function(y){if(!y)return;const w=y,S=[];if(w)for(let k of w){const z=Xn(k);z&&S.push(z)}return S}(e.bussinessRoutes),n=function(y){if(!y)return;const w=y;if(w&&w.length>0){const S=[];return w.forEach(k=>{const z=Vn(k);z&&S.push(z)}),S}}(e.widgetMenuConfig),i=function(y){if(y&&y.length>0){const w=[];return y.forEach(S=>{const k=function(z){return z?{id:z.id,label:z.label,container:z.container,preload:z.preload,afterid:z.afterid,bindid:z.bindid,group:z.group}:void 0}(S);k&&w.push(k)}),w}}(e.widgetConfig),o=function(y){if(y&&y.length>0)return y}(e.functionList),s=e.pkgObject.version,g=e.pkgObject.name;return{id:Mr(g,s),name:M.Config.UI.SiteTitle,group:M.Config.UI.Group,product:g,version:s,routes:t,widgetMenu:n,widgets:i,functions:o}}function Xn(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 i=[];for(let o of e.children){const s=Xn(o);s&&i.push(s)}i.length>0&&(n.children=i)}return n}}function Vn(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 i=Vn(n);i&&t.children?.push(i)})),t}function Lr(e,t="IconifyList.ts"){let n="",i=`const iconlist={
4
+ `,o=0;e.forEach(s=>{const g=s.split(":");if(g&&g.length===2){const y="icon"+o;n+=`import ${y} from '~icons/${g[0]}/${g[1]}'
5
+ `,i+=` '${s}':${y},
6
+ `,o++}}),o>0&&(i+=`};
7
+ `,Gt(n+i+"export default iconlist;","IconifyList.ts"))}function Rr(e,t){const n=Gn(e);Rn(n,t),M.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}const Z=Sn({panelGroups:{}}),Kn=()=>({useGroupAccordion:e=>ft(()=>Z.panelGroups[e].accordion),setGroupAccordionStatus:(e,t)=>{Z.panelGroups[e]={...Z.panelGroups[e],accordion:t}},panelExpanded:(e,t)=>ft(()=>Z.panelGroups[e]?.panelExpandStatus?.[t]||!1),setPanelExpandedStatus:(e,t,n)=>{Z.panelGroups[e]={...Z.panelGroups[e],panelExpandStatus:{...Z.panelGroups[e]?.panelExpandStatus||{},[t]:n}}},togglePanelExpandedStatus:(e,t)=>{Z.panelGroups[e].accordion&&(Z.panelGroups[e].panelExpandStatus[t]||Object.keys(Z.panelGroups[e].panelExpandStatus).forEach(n=>{Z.panelGroups[e].panelExpandStatus[n]=!1})),Z.panelGroups[e].panelExpandStatus[t]=!Z.panelGroups[e].panelExpandStatus[t]}}),je=e=>e>255?255:e<0?0:e,Jt=(e,t)=>{const n=e.replace("#",""),i=parseInt(n,16),o=je((i>>16)+t),s=je((i>>8&255)+t);return"#"+(je((255&i)+t)|s<<8|o<<16).toString(16)};var Zt=Lt({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(e){const t=nt(`group-${Ht()}`),{setGroupAccordionStatus:n}=Kn(),i={"--base-color":e.baseColor,"--border-color":Jt(e.baseColor,180),"--bg-color-header":Jt(e.baseColor,140),"--bg-color-header-hover":Jt(e.baseColor,190),"--bg-color-header-active":Jt(e.baseColor,200),"--bg-color-body":"#fff"};return n(t.value,e.accordion),{idGroup:t,cssColorVars:i}}});const Dr=["data-id-group"];Zt.render=function(e,t,n,i,o,s){return H(),et("div",{"data-id-group":e.idGroup,style:gt(e.cssColorVars),class:"vcpg"},[dt(e.$slots,"default")],12,Dr)},Zt.__scopeId="data-v-23ab5317",Zt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Qt=Lt({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(e,t){const n=`panel-${Ht()}`,i=nt(),o=nt(),s=nt(),{panelExpanded:g,togglePanelExpandedStatus:y,setPanelExpandedStatus:w}=Kn(),S=ft(()=>({hasContent:t.slots.content&&t.slots.content()[0].children.length>0,dataKey:Ht()})),k=ft(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),z=ft(()=>g(k.value,n).value&&S.value.hasContent);return we(()=>{w(k.value,n,e.expanded)}),so(()=>{(async()=>(await Ot(),o.value&&s.value&&(o.value.style.height=`${Math.min(s.value.scrollHeight,o.value.scrollHeight)}px`)))()}),{body:S,panelRef:i,bodyRef:o,bodyContentRef:s,isExpanded:z,collapse:B=>{B.style.height="0"},expand:B=>{B.style.height=`${B.scrollHeight}px`},toggle:()=>{!S.value.hasContent||y(k.value,n)},toggleIcon:`
8
8
  <svg
9
9
  width="24px"
10
10
  height="24px"
@@ -14,4 +14,4 @@ import{h as ro,openBlock as H,createElementBlock as tt,normalizeStyle as yt,rend
14
14
  >
15
15
  <path d="M6.34292 7.75734L4.92871 9.17155L11.9998 16.2426L19.0708 9.17158L17.6566 7.75737L11.9998 13.4142L6.34292 7.75734Z"/>
16
16
  </svg>
17
- `}}});const Tr={class:"vcp__header-title"},Br={key:0,class:"vcp__header-icon"},Ar=["innerHTML"],Dr={key:0,ref:"bodyRef",class:"vcp__body"},Nr={ref:"bodyContentRef",class:"vcp__body-content"};function je(e){return window.TouchEvent&&e instanceof TouchEvent}Qt.render=function(e,t,n,i,r,c){return H(),tt("section",{ref:"panelRef",class:ao(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[V("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...v)=>e.toggle&&e.toggle(...v))},[V("div",Tr,[ft(e.$slots,"title")]),e.body.hasContent?(H(),tt("div",Br,[ft(e.$slots,"icon",{},()=>[V("span",{innerHTML:e.toggleIcon},null,8,Ar)])])):zt("v-if",!0)]),xn(kn,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:Wt(()=>[e.isExpanded?(H(),tt("div",Dr,[V("div",Nr,[ft(e.$slots,"content")],512)],512)):zt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Qt.__scopeId="data-v-08c94cf8",Qt.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Z{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return je(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return je(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Je(this.clientX,this.clientY)}static bindDown(t,n,i,r=!1){const c=y=>{n(new Z(y))},v=y=>{y.touches.length===1&&n(new Z(y)),y.touches.length>1&&i&&i(new Z(y))};return t.addEventListener("mousedown",c,r),t.addEventListener("touchstart",v,r),()=>{t.removeEventListener("mousedown",c,r),t.removeEventListener("touchstart",v,r)}}static bindMove(t,n,i=!1){const r=v=>{n(new Z(v))},c=v=>{v.touches.length===1&&n(new Z(v))};return t.addEventListener("mousemove",r,i),t.addEventListener("touchmove",c,i),()=>{t.removeEventListener("mousemove",r,i),t.removeEventListener("touchmove",c,i)}}static bindUp(t,n,i=!1){const r=v=>{n(new Z(v))},c=v=>{v.touches.length===0&&n(new Z(v))};return t.addEventListener("mouseup",r,i),t.addEventListener("touchend",c,i),()=>{t.removeEventListener("mouseup",r,i),t.removeEventListener("touchend",c,i)}}originalEvent({mouse:t,touch:n}){je(this.e)?n&&n(this.e):t&&t(this.e)}}class Je{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Je(this.x,this.y)}}class Ur{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,i={}){this.handle=t,this.container=n,this.options=i,t&&(this.unbindDown=Z.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:i}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.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 Or{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(i=>i.push(this))}set group(t){this._group=t;const n=ee(this._group),i=ee(t);n.splice(n.indexOf(this),1),i.push(this),Zn()}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(ee(this._group)),Zn()}}const te=new Map;function ee(e){return te.has(e)||te.set(e,[]),te.get(e)}function Jn(e,t){return e>t?-Jn(t,e):e<0&&t>=0?1:e-t}function Zn(){let e=0;for(const t of function(n){const i=[];return n.forEach((r,c)=>i.push(c)),i}(te).sort(Jn))for(const n of ee(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function We(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const i=ne(e);return e.style.width=t,e.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function ne(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height,r=t.top,c=t.left;return{width:n,height:i,top:r,left:c,bottom:r+i,right:c+n}}class jr{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=Qn.map(w=>new w(t,this));const{width:i,height:r}=We(t),c=n.maxWidth||window.innerWidth,v=n.maxHeight||window.innerHeight;let y=!1;(i<n.minWidth||i>c)&&(t.style.width=`${ti(i,n.minWidth,c)}px`,y=!0),(r<n.minHeight||r>v)&&(t.style.height=`${ti(r,n.minHeight,v)}px`,y=!0),y&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const Qn=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=Z.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:i,width:r,height:c}=ne(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=c,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:i,bottom:r}=ne(this.container),c=this.helper.options,v=c.maxWidth||window.innerWidth,y=c.maxHeight||window.innerHeight;this.minLeft=Math.max(i-v,0),this.maxLeft=i-c.minWidth,this.minRight=t+c.minWidth,this.maxRight=Math.min(t+v,window.innerWidth),this.minTop=Math.max(r-y,0),this.maxTop=r-c.minHeight,this.minBottom=n+c.minHeight,this.maxBottom=Math.min(n+y,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:i,top:r,right:c,bottom:v}=ne(this.container),y=this.helper.options;y&&(i<this.minLeft?(this.container.style.width=t+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${y.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):c<this.minRight?this.container.style.width=`${y.minWidth}px`:c>this.maxRight&&(this.container.style.width=this.maxRight-i+"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=`${y.minHeight}px`,this.container.style.top=`${this.maxTop}px`):v<this.minBottom?this.container.style.height=`${y.minHeight}px`:v>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 ti(e,t,n){return e<t?t:e>n?n:e}Qn.push(class extends gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 ie=Tt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=nt(!1),n=nt(!1);return{hover:t,active:n,style:function(){let i=e.windowStyle.button;return t.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=Z.bindUp(document,()=>{n.value=!1,r()})}}}});const Wr=["disabled"];ie.render=function(e,t,n,i,r,c){return H(),tt("div",{class:"btn",style:yt(e.style()),onMouseenter:t[0]||(t[0]=v=>e.hover=!0),onMouseleave:t[1]||(t[1]=v=>e.hover=!1),onMousedown:t[2]||(t[2]=En((...v)=>e.mousedown&&e.mousedown(...v),["stop"])),onTouchstart:t[3]||(t[3]=En((...v)=>e.mousedown&&e.mousedown(...v),["stop"])),onMouseup:t[4]||(t[4]=(...v)=>e.mouseup&&e.mouseup(...v)),onTouchend:t[5]||(t[5]=(...v)=>e.mouseup&&e.mouseup(...v)),disabled:e.disabled},[ft(e.$slots,"default")],44,Wr)},ie.__scopeId="data-v-71662210",ie.__file="src/controls/vuewindow/window/Button.vue";const Fe=new Set;function ei(e){return e!==null?parseFloat(e):0}function oe(e){const t=window.getComputedStyle(e);return{width:Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(ei).reduce((n,i)=>n+i)),height:Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(ei).reduce((n,i)=>n+i))}}class ni{width;height;constructor(t,n){this.width=t,this.height=n}}function Fr(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),i=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function $r(e,t,n,i){const r=e-n,c=t-i;return r*r+c*c}window.addEventListener("resize",e=>{Fe.forEach(t=>{t?.fixPosition()})});const re=[];var se=Tt({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:ie},setup(e,{emit:t}){const n=co();if(!n)return;const{proxy:i}=n;let r=0,c,v,y;const w=nt(e.isOpen),S=()=>{re.push(i),y=new Or(e.zGroup,k),e.isOpen&&(Cn(()=>{r++==0&&(h(i),function(){const R=z.value,{width:B,height:U}=We(R);let O,j;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,j=e.top;else{const $=e.positionHint||"auto";switch($){case"auto":{let G=20,X=50,it=0;do{if(re.every(Q=>{if(!Q.isOpen||i==Q)return!0;const st=Fr(Q);if(st==null)return!0;const{left:le,top:he}=st;return $r(le,he,G,X)>16}))break;G=(G+40)%(window.innerWidth-200),X=(X+40)%(window.innerHeight-200)}while(++it<100);O=G,j=X}break;case"center":O=(window.innerWidth-B)/2,j=(window.innerHeight-U)/2,console.log(O,j,window.innerWidth,window.innerHeight,"111111");break;default:try{const G=$.split("/").map(Number);if(G.length!=2)throw null;const[X,it]=G;if(!isFinite(X)||!isFinite(it))throw null;O=X>=0?X:window.innerWidth-B+X,j=it>=0?it:window.innerHeight-U+it}catch{throw new Error(`invalid position string: ${$}`)}}}R&&(R.style.left=`${O}px`,R.style.top=`${j}px`)}()),e.resizable&&l(),T(),c=new Ur(I.value,z.value,{onMove:()=>T(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:R}=We(I.value);v=new jr(z.value,{onResize:()=>l(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+R,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+R:void 0})}()}),e.activateWhenOpen&&P()),Fe.add(i)};function k(R){b.value.zIndex=`${R}`}const z=nt(null),I=nt(null),D=nt(null);function P(){y.raise(),t("activate")}const b=nt({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=pt(()=>e.windowStyle.titlebar),d=pt(()=>{const R={...e.windowStyle.content};return e.resizable?R.padding="0":e.padding!=null&&(R.padding=`${e.padding}px`),e.isScrollable&&(R.overflow="auto"),R});function h(R){const{width:B,height:U,top:O,left:j}=R,$=z;if($&&B!=null&&($.value.style.width=`${B}px`),U!=null){const G=I.value;if(G){const X=oe(G).height;$.value.style.height=`${U+X}px`}}$&&j!=null&&($.value.style.left=`${j}px`),$&&O!=null&&($.value.style.top=`${O}px`)}function l(R=!0){const B=z.value,U=I.value,O=D.value;if(O&&B&&U){const{width:j,height:$}=oe(O),{width:G,height:X}=oe(B),it=oe(U).height,Q=G-(O.offsetWidth-j),st=X-it-(O.offsetHeight-$);O.style.width=`${Q}px`,O.style.height=`${st}px`,p(),t("resize",new ni(Q,st)),R&&(t("update:width",Q),t("update:height",st))}}function p(){const R=z.value;if(R){const B=R.getBoundingClientRect();B.left<0&&(b.value.left="0px"),B.top<0&&(b.value.top="0px"),B.right>window.innerWidth&&(b.value.left=window.innerWidth-B.width+"px"),B.bottom>window.innerHeight&&(b.value.top=window.innerHeight-B.height+"px")}}function T(R=!0){p();const B=z.value;if(B){const{left:U,top:O}=B.getBoundingClientRect();R&&(t("update:left",U),t("update:top",O))}}return Ft(()=>e.isOpen,R=>{w.value=R}),Ft(()=>e.zGroup,R=>{y.group=R}),Ft(()=>e.width,R=>{h({width:R}),l(!1)}),Ft(()=>e.height,R=>{h({height:R}),l(!1)}),Sn(()=>{S()}),uo(()=>{Fe.delete(this),y.unregister(),v&&v.teardown(),c&&c.teardown(),re.splice(re.indexOf(i),1)}),{isOpen:w,windowEl:z,titlebar:I,content:D,activate:P,styleWindow:b,styleTitlebar:u,styleContent:d,closeButtonClick:function(){w.value=!1,t("closebuttonclick")}}}});const Hr={class:"title"},qr=Mn("\xD7");var ii,vt;se.render=function(e,t,n,i,r,c){const v=zn("myButton");return H(),ct(kn,{name:"fade",onAfterLeave:t[2]||(t[2]=y=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=y=>e.$emit("open"))},{default:Wt(()=>[lo(V("div",{class:"window",style:yt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...y)=>e.activate&&e.activate(...y)),onTouchstart:t[1]||(t[1]=(...y)=>e.activate&&e.activate(...y))},[V("div",{class:"titlebar",style:yt(e.styleTitlebar),ref:"titlebar"},[V("div",Hr,[e.$slots.title?ft(e.$slots,"title",{key:0}):(H(),tt(wt,{key:1},[Mn(ho(e.title),1)],2112))]),e.closeButton?(H(),ct(v,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:Wt(()=>[qr]),_:1},8,["windowStyle","onClick"])):zt("v-if",!0)],4),V("div",{class:"content",style:yt(e.styleContent),ref:"content"},[ft(e.$slots,"default")],4)],36),[[fo,e.isOpen]])]),_:3})},se.__file="src/controls/vuewindow/window/index.vue",(vt=ii||(ii={}))[vt.StyleBlack=0]="StyleBlack",vt[vt.StyleWhite=1]="StyleWhite",vt[vt.StyleMetal=2]="StyleMetal",vt[vt.StyleGrayblue=3]="StyleGrayblue";const Gr={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)"}},Xr={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)"}},Vr={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)"}},Kr={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)"}},Yr=se;var q,et;(et=q||(q={}))[et.top=0]="top",et[et.bottom=1]="bottom",et[et.centerBack=2]="centerBack",et[et.centerMain=3]="centerMain",et[et.centerFront=4]="centerFront",et[et.left=5]="left",et[et.right=6]="right";class Jr{layoutState;widgetCofig;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;constructor(t,n){this.layoutState=t,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(t){if(!t)return;let n;xt(t)?n=t:Yt(t)&&(n=this.widgetCofig.find(i=>i.id===t)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t,n){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(i=>{if(i.default){const r=_n(i.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),L.EventBus.emit(K.WidgetLoadedEvent,t.id),n&&n(t.id)}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetCofig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i)for(const r of i)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),L.EventBus.emit(K.WidgetUnLoadedEvent,t)}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&L.EventBus.emit(K.WidgetVisibleChanged,{id:t,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetCofig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetCofig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetCofig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}var $e=Tt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutStyle:{type:Object}},components:{},setup(e,{attrs:t,slots:n,emit:i}){const r=bn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0});if(!L.LayoutManager){const D=new Jr(r,e.widgetConfig);L.LayoutManager=D,D.preloadWidgets()}const c=z(q.top),v=z(q.centerBack),y=z(q.centerFront),w=z(q.left),S=z(q.right),k=z(q.bottom);function z(D){return L.LayoutManager?.getContainerComponents(D)}const I=pt(()=>e.layoutStyle);return{...po(r),topContainerComponents:c,centerbackComponents:v,centerfrontComponents:y,leftContainerComponents:w,rightContainerComponents:S,bottomContainerComponents:k,containerStyle:I}}});const Zr={ref:"topContainer",class:"topContainer"},Qr={ref:"centerBackContainer",class:"centerdiv backContainer"},ts={ref:"centerMainContainer",class:"centerdiv mainContainer"},es={ref:"centerFrontContainer",class:"centerdiv centerContainer"},ns={ref:"leftContainer",class:"leftContainer"},is={ref:"rightContainer",class:"rightContainer"},os={ref:"bottomContainer",class:"bottomContainer"};$e.render=function(e,t,n,i,r,c){const v=zn("router-view");return H(),tt("div",{class:"layoutContainer",style:yt(e.containerStyle)},[V("div",Zr,[(H(!0),tt(wt,null,Mt(e.topContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),V("div",null,[zt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),V("div",Qr,[(H(!0),tt(wt,null,Mt(e.centerbackComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),zt(" \u4E3B\u8981\u5BB9\u5668 "),V("div",ts,[xn(v,null,{default:Wt(({Component:y})=>[(H(),ct(bt(y)))]),_:1})],512),zt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),V("div",es,[(H(!0),tt(wt,null,Mt(e.centerfrontComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),V("div",ns,[(H(!0),tt(wt,null,Mt(e.leftContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512),V("div",is,[(H(!0),tt(wt,null,Mt(e.rightContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512)]),V("div",os,[(H(!0),tt(wt,null,Mt(e.bottomContainerComponents,([y,w])=>(H(),ct(bt(w),{key:y}))),128))],512)],4)},$e.__file="src/controls/layoutcontainer/layout.vue";class rs{layoutState;widgetCofig;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;constructor(t,n){this.layoutState=t,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(t){if(!t)return;let n;xt(t)?n=t:Yt(t)&&(n=this.widgetCofig.find(i=>i.id===t)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t,n){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(i=>{if(i.default){const r=_n(i.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),L.EventBus.emit(K.WidgetLoadedEvent,t.id),n&&n(t.id)}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetCofig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i)for(const r of i)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),L.EventBus.emit(K.WidgetUnLoadedEvent,t)}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&L.EventBus.emit(K.WidgetVisibleChanged,{id:t,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetCofig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetCofig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetCofig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}const ae=new Map,He=new Map;let ce;const ss={getDefaultClient(){if(ce||(ce=new Bt(SysConfig.DefaultHproseAPI)),!ce)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return ce},registerHprose(e,t){const n=He.get(e);if(!n){const i=new Bt(t);ae.set(e,i)}return n},getHprose:e=>He?.get(e),getProxyHprose:e=>ae.get(e),unregisterHprose(e){ae.get(e)&&(He.delete(e),ae.delete(e))}},as=4e3,kt={Login:"/api/Login/Login",CheckLogin:"\u200B/api\u200B/Check\u200B/Login",Logout:"/api/Check/ExitLogin",ChangePWD:"/api/UserManager/UpdateUserPWD",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken"},cs=L.Config.ServiceURL.LoginAuthURL;function qe(){const e=Bn();e&&rt(kt.RefreshToken,cs,{refreshToken:e}).then(t=>{ue(t.data)})}function oi(e){L.User||(L.User={id:e.id,name:e.name,issystem:e.issystem,issecurity:e.issecurity,appkey:e.appkey,role:e.role,doubleToken:{accessToken:{tokenContent:e.token,expires:e.expire},refreshToken:{tokenContent:e.refresh,expires:e.expire}}});const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=4e3?qe():setTimeout(qe,n-4e3))}function ue(e){L.User&&(L.User.doubleToken=e);const t=new Date().getTime(),n=new Date(e.accessToken.expires).getTime()-t;if(n>0&&L.User){let i=Ct();if(!i){const r=L.User.doubleToken;i={id:L.User.id,name:L.User.name,token:r?r.accessToken.tokenContent:"",expire:r?r.accessToken.expires:"",refresh:r?r.accessToken.tokenContent:"",issystem:L.User.issystem,issecurity:L.User.issecurity,appkey:L.User.appkey,role:L.User.role}}i.token=e.accessToken.tokenContent,i.expire=e.accessToken.expires,i.refresh=e.refreshToken.tokenContent,mt.set("access_token",i,n/1e3),oi(i)}else mt.remove("access_token")}function Ge(e){L.User=e}const Dt=L.Config.ServiceURL.LoginAuthURL;async function us(e){const t=(await rt(kt.Login,Dt,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),ue(t.resultValue.doubleToken)),t}async function ls(e){const t=(await rt(kt.CheckLogin,Dt,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),ue(t.resultValue.doubleToken)),t}function hs(e){return rt(kt.ChangePWD,Dt,e)}function ds(){const e=Ct();e&&(Le(kt.Logout,Dt,{token:e.token,reftoken:e.refresh}),_e())}function fs(e){return rt(kt.CheckToken,Dt,{token:e})}const Xe=new Ht("",sessionStorage);function ri(){return Xe.get("ROLE_SYSTEM_RIGHT")}function si(e){Xe.set("ROLE_SYSTEM_RIGHT",e)}function ai(){Xe.remove("ROLE_SYSTEM_RIGHT")}const Ve=[],Ke=[],Ye=[];function Nt(){return ri()}async function ps(e,t,n,i){if(ai(),!L.User)return;let r;if(i)r=i;else{if(!t)return;let c=n;c||(c=L.Config.ServiceURL.LoginAuthURL);const v=await rt(t,c,{system:e});if(!v||!v.data)return void L.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");r=v.data}return r&&si(r),r}function ci(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(i=>{const r=e.children?.find(c=>c.path===i.path);if(r){const c=ci(r,i);c&&n.children?.push(c)}})),n}function ms(e){if(L.User?.issystem)return e;const t=Nt();return t&&t.routes?(Ye.length>0||e.forEach(n=>{const i=t.routes?.find(r=>r.name===n.name);if(i){const r=ci(n,i);r&&Ye.push(r)}}),Ye):void 0}function ui(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(i=>{const r=e.children?.find(c=>c.name===i.name);if(r){const c=ui(r,i);c&&n.children?.push(c)}})),n}function gs(e){if(L.User?.issystem)return e;const t=Nt();return t&&t.widgetMenu?(Ke.length>0||e.forEach(n=>{const i=t.widgetMenu?.find(r=>r.name===n.name);if(i){const r=ui(n,i);r&&Ke.push(r)}}),Ke):void 0}function vs(e){if(L.User?.issystem)return e;const t=Nt();return t&&t.widgets?(Ve.length>0||e?.forEach(n=>{t.widgets?.find(i=>i.id===n.id)&&Ve.push(n)}),Ve):void 0}function ys(e){if(L.User?.issystem)return e;const t=Nt();return t?t.functions:void 0}export{cr as BigFileDownload,Xt as Download,Bo as DownloadByUrl,St as EnumColor,L as Global,ss as GlobalHprose,It as GlobalMitt,lt as H5Tool,Ut as HproseClient,To as HttpDownload,Pn as JsonDownload,$e as LayoutContainer,q as LayoutContainerEnum,rs as LayoutManager,Rr as ObjToUrlParams,be as Pane,Bt as ProxyClient,Po as SaveAs,yo as Splitpanes,Ht as Storage,$t as StringUtils,Gr as StyleBlack,Kr as StyleGrayblue,Vr as StyleMetal,Xr as StyleWhite,K as SysEvents,as as TOKEN_REFRESH_TIME,kt as USER_TOKEN_API,Qt as VCollapsiblePanel,Zt as VCollapsiblePanelGroup,se as VWindow,ni as WindowResizeEvent,Yr as WindowType,Lo as calculateBestTextColor,hs as changePWD,oi as checkDoRefreshToken,ls as checkLogin,fs as checkToken,_e as clearLocalToken,ai as clearRight,_o as colorIsDark,er as createFileUpload,Ro as darken,Gn as deepMerge,qe as doRefreshToken,Xn as exportSystemRights,jo as get,Nt as getCurrentSystemRight,Fo as getData,ys as getFunctions,Co as getHexColor,Ct as getLocalToken,ir as getLockState,ko as getLongHexColor,Dn as getProxyClient,xo as getRGBColor,zo as getRGBColorFromHSLA,Bn as getRefreshToken,ri as getRight,ms as getRoutes,ps as getSystemRoleRight,vs as getWidgetConfig,gs as getWidgetMenus,ke as hexToRGB,An as init,Uo as initDefaultProxyClient,No as initXFrame,Y as is,qn as isArray,pr as isAsyncFunction,gr as isBoolean,vr as isClient,dr as isDate,Hn as isDef,wr as isElement,Cr as isEmpty,Eo as isEnumColor,xr as isError,De as isFunction,Gt as isHexColor,Sr as isImageDom,Mr as isMap,Ue as isNull,lr as isNullAndUnDef,hr as isNullOrUnDef,fr as isNumber,xt as isObject,mr as isPromise,br as isServer,Yt as isString,zr as isSymbol,Ne as isUnDef,_r as isValidURL,Er as isWeakMap,kr as isWeakSet,yr as isWindow,nr as jquery,Io as lighten,us as login,ds as logout,So as newGuid,or as onLockListener,Wo as post,rt as requestGet,Le as requestPost,Oo as requestPostBody,Mo as rgbToHex,ue as setLocalToken,si as setRight,Ge as setUser,Ao as sleep,bo as storage,mt as storageHelper,rr as unLockListener,qt as uuid,Ir as writeIconifyList,Lr as writeSysRoleRight};
17
+ `}}});const Pr={class:"vcp__header-title"},Tr={key:0,class:"vcp__header-icon"},Ar=["innerHTML"],Br={key:0,ref:"bodyRef",class:"vcp__body"},Nr={ref:"bodyContentRef",class:"vcp__body-content"};function We(e){return window.TouchEvent&&e instanceof TouchEvent}Qt.render=function(e,t,n,i,o,s){return H(),et("section",{ref:"panelRef",class:ao(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[V("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...g)=>e.toggle&&e.toggle(...g))},[V("div",Pr,[dt(e.$slots,"title")]),e.body.hasContent?(H(),et("div",Tr,[dt(e.$slots,"icon",{},()=>[V("span",{innerHTML:e.toggleIcon},null,8,Ar)])])):kt("v-if",!0)]),Cn(xn,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:jt(()=>[e.isExpanded?(H(),et("div",Br,[V("div",Nr,[dt(e.$slots,"content")],512)],512)):kt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Qt.__scopeId="data-v-08c94cf8",Qt.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Q{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return We(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return We(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Ze(this.clientX,this.clientY)}static bindDown(t,n,i,o=!1){const s=y=>{n(new Q(y))},g=y=>{y.touches.length===1&&n(new Q(y)),y.touches.length>1&&i&&i(new Q(y))};return t.addEventListener("mousedown",s,o),t.addEventListener("touchstart",g,o),()=>{t.removeEventListener("mousedown",s,o),t.removeEventListener("touchstart",g,o)}}static bindMove(t,n,i=!1){const o=g=>{n(new Q(g))},s=g=>{g.touches.length===1&&n(new Q(g))};return t.addEventListener("mousemove",o,i),t.addEventListener("touchmove",s,i),()=>{t.removeEventListener("mousemove",o,i),t.removeEventListener("touchmove",s,i)}}static bindUp(t,n,i=!1){const o=g=>{n(new Q(g))},s=g=>{g.touches.length===0&&n(new Q(g))};return t.addEventListener("mouseup",o,i),t.addEventListener("touchend",s,i),()=>{t.removeEventListener("mouseup",o,i),t.removeEventListener("touchend",s,i)}}originalEvent({mouse:t,touch:n}){We(this.e)?n&&n(this.e):t&&t(this.e)}}class Ze{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Ze(this.x,this.y)}}class Ur{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,i={}){this.handle=t,this.container=n,this.options=i,t&&(this.unbindDown=Q.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:i}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Q.bindMove(document,this.mousemove),this.unbindUp=Q.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 Or{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(i=>i.push(this))}set group(t){this._group=t;const n=ee(this._group),i=ee(t);n.splice(n.indexOf(this),1),i.push(this),Jn()}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(ee(this._group)),Jn()}}const te=new Map;function ee(e){return te.has(e)||te.set(e,[]),te.get(e)}function Yn(e,t){return e>t?-Yn(t,e):e<0&&t>=0?1:e-t}function Jn(){let e=0;for(const t of function(n){const i=[];return n.forEach((o,s)=>i.push(s)),i}(te).sort(Yn))for(const n of ee(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Fe(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const i=ne(e);return e.style.width=t,e.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function ne(e){const t=e.getBoundingClientRect(),n=t.width,i=t.height,o=t.top,s=t.left;return{width:n,height:i,top:o,left:s,bottom:o+i,right:s+n}}class jr{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=Zn.map(w=>new w(t,this));const{width:i,height:o}=Fe(t),s=n.maxWidth||window.innerWidth,g=n.maxHeight||window.innerHeight;let y=!1;(i<n.minWidth||i>s)&&(t.style.width=`${Qn(i,n.minWidth,s)}px`,y=!0),(o<n.minHeight||o>g)&&(t.style.height=`${Qn(o,n.minHeight,g)}px`,y=!0),y&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const Zn=[];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=Q.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:i,width:o,height:s}=ne(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=i,this.width0=o,this.height0=s,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Q.bindMove(document,this.mousemove),this.unbindUp=Q.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:i,bottom:o}=ne(this.container),s=this.helper.options,g=s.maxWidth||window.innerWidth,y=s.maxHeight||window.innerHeight;this.minLeft=Math.max(i-g,0),this.maxLeft=i-s.minWidth,this.minRight=t+s.minWidth,this.maxRight=Math.min(t+g,window.innerWidth),this.minTop=Math.max(o-y,0),this.maxTop=o-s.minHeight,this.minBottom=n+s.minHeight,this.maxBottom=Math.min(n+y,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:i,top:o,right:s,bottom:g}=ne(this.container),y=this.helper.options;!y||(i<this.minLeft?(this.container.style.width=t+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${y.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):s<this.minRight?this.container.style.width=`${y.minWidth}px`:s>this.maxRight&&(this.container.style.width=this.maxRight-i+"px"),o<this.minTop?(this.container.style.height=n+o-this.minTop+"px",this.container.style.top=`${this.minTop}px`):o>this.maxTop?(this.container.style.height=`${y.minHeight}px`,this.container.style.top=`${this.maxTop}px`):g<this.minBottom?this.container.style.height=`${y.minHeight}px`:g>this.maxBottom&&(this.container.style.height=this.maxBottom-o+"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 Qn(e,t,n){return e<t?t:e>n?n:e}Zn.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 ie=Lt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=nt(!1),n=nt(!1);return{hover:t,active:n,style:function(){let i=e.windowStyle.button;return t.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const o=Q.bindUp(document,()=>{n.value=!1,o()})}}}});const Wr=["disabled"];ie.render=function(e,t,n,i,o,s){return H(),et("div",{class:"btn",style:gt(e.style()),onMouseenter:t[0]||(t[0]=g=>e.hover=!0),onMouseleave:t[1]||(t[1]=g=>e.hover=!1),onMousedown:t[2]||(t[2]=kn((...g)=>e.mousedown&&e.mousedown(...g),["stop"])),onTouchstart:t[3]||(t[3]=kn((...g)=>e.mousedown&&e.mousedown(...g),["stop"])),onMouseup:t[4]||(t[4]=(...g)=>e.mouseup&&e.mouseup(...g)),onTouchend:t[5]||(t[5]=(...g)=>e.mouseup&&e.mouseup(...g)),disabled:e.disabled},[dt(e.$slots,"default")],44,Wr)},ie.__scopeId="data-v-71662210",ie.__file="src/controls/vuewindow/window/Button.vue";const $e=new Set;function ti(e){return e!==null?parseFloat(e):0}function oe(e){const t=window.getComputedStyle(e);return{width:Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(ti).reduce((n,i)=>n+i)),height:Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(ti).reduce((n,i)=>n+i))}}class ei{width;height;constructor(t,n){this.width=t,this.height=n}}function Fr(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),i=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function $r(e,t,n,i){const o=e-n,s=t-i;return o*o+s*s}window.addEventListener("resize",e=>{$e.forEach(t=>{t&&Kt(t.fixPosition)&&t.fixPosition()})});const re=[];var se=Lt({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:ie},setup(e,{emit:t}){const n=co();if(!n)return;const{proxy:i}=n;let o=0,s,g,y;const w=nt(e.isOpen),S=()=>{re.push(i),y=new Or(e.zGroup,k),e.isOpen&&function(L){L&&(Ot(()=>{o++==0&&(h(i),function(){const R=z.value,{width:U,height:j}=Fe(R);let O,$;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,$=e.top;else{const tt=e.positionHint||"auto";switch(tt){case"auto":{let X=20,Y=50,G=0;do{if(re.every(rt=>{if(!rt.isOpen||i==rt)return!0;const Bt=Fr(rt);if(Bt==null)return!0;const{left:he,top:it}=Bt;return $r(he,it,X,Y)>16}))break;X=(X+40)%(window.innerWidth-200),Y=(Y+40)%(window.innerHeight-200)}while(++G<100);O=X,$=Y}break;case"center":O=(window.innerWidth-U)/2,$=(window.innerHeight-j)/2,console.log(O,$,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=tt.split("/").map(Number);if(X.length!=2)throw null;const[Y,G]=X;if(!isFinite(Y)||!isFinite(G))throw null;O=Y>=0?Y:window.innerWidth-U+Y,$=G>=0?G:window.innerHeight-j+G}catch{throw new Error(`invalid position string: ${tt}`)}}}R&&(R.style.left=`${O}px`,R.style.top=`${$}px`)}()),e.resizable&&l(),P(),s=new Ur(B.value,z.value,{onMove:()=>P(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:R}=Fe(B.value);g=new jr(z.value,{onResize:()=>l(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+R,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+R:void 0})}()}),e.activateWhenOpen&&D())}(!0),$e.add(i)};function k(L){b.value.zIndex=`${L}`}const z=nt(null),B=nt(null),A=nt(null);function D(){y.raise(),t("activate")}const b=nt({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=ft(()=>e.windowStyle.titlebar),d=ft(()=>{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 h(L){const{width:R,height:U,top:j,left:O}=L,$=z;if($&&R!=null&&($.value.style.width=`${R}px`),U!=null){const tt=B.value;if(tt){const X=oe(tt).height;$.value.style.height=`${U+X}px`}}$&&O!=null&&($.value.style.left=`${O}px`),$&&j!=null&&($.value.style.top=`${j}px`)}function l(L=!0){const R=z.value,U=B.value,j=A.value;if(j&&R&&U){const{width:O,height:$}=oe(j),{width:tt,height:X}=oe(R),Y=oe(U).height,G=tt-(j.offsetWidth-O),rt=X-Y-(j.offsetHeight-$);j.style.width=`${G}px`,j.style.height=`${rt}px`,p(),t("resize",new ei(G,rt)),L&&(t("update:width",G),t("update:height",rt))}}function p(){const L=z.value;if(L){const R=L.getBoundingClientRect();R.left<0&&(b.value.left="0px"),R.top<0&&(b.value.top="0px"),R.right>window.innerWidth&&(b.value.left=window.innerWidth-R.width+"px"),R.bottom>window.innerHeight&&(b.value.top=window.innerHeight-R.height+"px")}}function P(L=!0){p();const R=z.value;if(R){const{left:U,top:j}=R.getBoundingClientRect();L&&(t("update:left",U),t("update:top",j))}}return Wt(()=>e.isOpen,L=>{w.value=L}),Wt(()=>e.zGroup,L=>{y.group=L}),Wt(()=>e.width,L=>{h({width:L}),l(!1)}),Wt(()=>e.height,L=>{h({height:L}),l(!1)}),we(()=>{S()}),uo(()=>{$e.delete(this),y.unregister(),g&&g.teardown(),s&&s.teardown(),re.splice(re.indexOf(i),1)}),{isOpen:w,windowEl:z,titlebar:B,content:A,activate:D,styleWindow:b,styleTitlebar:u,styleContent:d,closeButtonClick:function(){w.value=!1,t("closebuttonclick")},fixPosition:p}}});const Hr={class:"title"},qr=En("\xD7");var ni;se.render=function(e,t,n,i,o,s){const g=zn("myButton");return H(),ct(xn,{name:"fade",onAfterLeave:t[2]||(t[2]=y=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=y=>e.$emit("open"))},{default:jt(()=>[lo(V("div",{class:"window",style:gt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...y)=>e.activate&&e.activate(...y)),onTouchstart:t[1]||(t[1]=(...y)=>e.activate&&e.activate(...y))},[V("div",{class:"titlebar",style:gt(e.styleTitlebar),ref:"titlebar"},[V("div",Hr,[e.$slots.title?dt(e.$slots,"title",{key:0}):(H(),et(vt,{key:1},[En(ho(e.title),1)],2112))]),e.closeButton?(H(),ct(g,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:jt(()=>[qr]),_:1},8,["windowStyle","onClick"])):kt("v-if",!0)],4),V("div",{class:"content",style:gt(e.styleContent),ref:"content"},[dt(e.$slots,"default")],4)],36),[[fo,e.isOpen]])]),_:3})},se.__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"}(ni||(ni={}));const Gr={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)"}},Xr={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)"}},Vr={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)"}},Kr={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)"}},Yr=se;var q;(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"})(q||(q={}));class Jr{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(t,n,i){this.layoutState=t,this._LayoutID=i,n.forEach(o=>{if(o.layoutID===i&&(this.widgetConfig.push(o),o.afterid))if(this.preConditionMap.has(o.afterid))this.preConditionMap.get(o.afterid)?.add(o);else{const s=new Set;s.add(o),this.preConditionMap.set(o.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;return St(t)?n=t:Yt(t)&&(n=this.widgetConfig.find(i=>i.id===t)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}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 i=In(n.default);this.getContainerComponents(t.container).value.set(t.id,i),this.widgetsLoadedSet.add(t.id),Ot().then(()=>{M.EventBus.emit(K.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const o of i)if(this.isWidgetLoaded(o.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const s=this.preConditionMap.get(t);if(s)for(const g of s)this.unloadWidget(g.id)}const i=this.getContainerComponents(n.container),o=i.value.get(t);o&&o.unmounted&&o.unmounted(),i.value.delete(t),this.widgetsLoadedSet.delete(t),M.EventBus.emit(K.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&M.EventBus.emit(K.WidgetVisibleChanged,{id:t,layoutID:this._LayoutID,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetConfig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.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=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}var ae=Lt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object}},emits:["containerLoaded"],setup(e,{attrs:t,slots:n,emit:i}){const o=e.layoutID,s=Sn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),g=new Jr(s,e.widgetConfig,o),y=A(q.top),w=A(q.centerBack),S=A(q.centerFront),k=A(q.left),z=A(q.right),B=A(q.bottom);function A(b){return g?.getContainerComponents(b)}const D=ft(()=>e.layoutStyle);return we(()=>{g&&(g.preloadWidgets(),o===void 0&&(M.LayoutManager=g),i("containerLoaded",{layoutID:o,layoutManager:g}))}),{...po(s),topContainerComponents:y,centerbackComponents:w,centerfrontComponents:S,leftContainerComponents:k,rightContainerComponents:z,bottomContainerComponents:B,containerStyle:D}}});const Zr={ref:"topContainer",class:"topContainer"},Qr={ref:"centerBackContainer",class:"centerdiv backContainer"},ts={ref:"centerMainContainer",class:"centerdiv mainContainer"},es={ref:"centerFrontContainer",class:"centerdiv centerContainer"},ns={ref:"leftContainer",class:"leftContainer"},is={ref:"rightContainer",class:"rightContainer"},os={ref:"bottomContainer",class:"bottomContainer"};ae.render=function(e,t,n,i,o,s){const g=zn("router-view");return H(),et("div",{class:"layoutContainer",style:gt(e.containerStyle)},[V("div",Zr,[(H(!0),et(vt,null,Et(e.topContainerComponents,([y,w])=>(H(),ct(yt(w),{key:y}))),128))],512),V("div",null,[kt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),V("div",Qr,[(H(!0),et(vt,null,Et(e.centerbackComponents,([y,w])=>(H(),ct(yt(w),{key:y}))),128))],512),kt(" \u4E3B\u8981\u5BB9\u5668 "),V("div",ts,[Cn(g,null,{default:jt(({Component:y})=>[(H(),ct(yt(y)))]),_:1})],512),kt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),V("div",es,[(H(!0),et(vt,null,Et(e.centerfrontComponents,([y,w])=>(H(),ct(yt(w),{key:y}))),128))],512),V("div",ns,[(H(!0),et(vt,null,Et(e.leftContainerComponents,([y,w])=>(H(),ct(yt(w),{key:y}))),128))],512),V("div",is,[(H(!0),et(vt,null,Et(e.rightContainerComponents,([y,w])=>(H(),ct(yt(w),{key:y}))),128))],512)]),V("div",os,[(H(!0),et(vt,null,Et(e.bottomContainerComponents,([y,w])=>(H(),ct(yt(w),{key:y}))),128))],512)],4)},ae.__scopeId="data-v-4d081e5c",ae.__file="src/controls/layoutcontainer/layout.vue";class rs{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(t,n,i){this.layoutState=t,this._LayoutID=i,n.forEach(o=>{if(o.layoutID===i&&(this.widgetConfig.push(o),o.afterid))if(this.preConditionMap.has(o.afterid))this.preConditionMap.get(o.afterid)?.add(o);else{const s=new Set;s.add(o),this.preConditionMap.set(o.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;return St(t)?n=t:Yt(t)&&(n=this.widgetConfig.find(i=>i.id===t)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}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 i=In(n.default);this.getContainerComponents(t.container).value.set(t.id,i),this.widgetsLoadedSet.add(t.id),Ot().then(()=>{M.EventBus.emit(K.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const i=this.preConditionMap.get(t);if(i){for(const o of i)if(this.isWidgetLoaded(o.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(i=>i.id===t);if(n){if(this.preConditionMap.has(t)){const s=this.preConditionMap.get(t);if(s)for(const g of s)this.unloadWidget(g.id)}const i=this.getContainerComponents(n.container),o=i.value.get(t);o&&o.unmounted&&o.unmounted(),i.value.delete(t),this.widgetsLoadedSet.delete(t),M.EventBus.emit(K.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(t){switch(t){case q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const i=this.getLayoutContainer(t);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const i=this.getWidgetComponent(t);i&&M.EventBus.emit(K.WidgetVisibleChanged,{id:t,layoutID:this._LayoutID,name:i.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetConfig.find(i=>i.id===t);if(n)return this.getContainerComponents(n.container).value.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=nt(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}const ce=new Map,He=new Map;let ue;const ss={getDefaultClient(){if(ue||(ue=new Rt(SysConfig.DefaultHproseAPI)),!ue)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return ue},registerHprose(e,t){const n=He.get(e);if(!n){const i=new Rt(t);ce.set(e,i)}return n},getHprose:e=>He?.get(e),getProxyHprose:e=>ce.get(e),unregisterHprose(e){ce.get(e)&&(He.delete(e),ce.delete(e))}},as=4e3,Ct={Login:"/api/Login/Login",CheckLogin:"\u200B/api\u200B/Check\u200B/Login",Logout:"/api/Check/ExitLogin",ChangePWD:"/api/UserManager/UpdateUserPWD",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken"},ii="access_token",cs=M.Config.ServiceURL.LoginAuthURL;function qe(){const e=Tn();e&&at(Ct.RefreshToken,cs,{refreshToken:e}).then(t=>{le(t.data)})}function oi(e){M.User||(M.User={id:e.id,name:e.name,issystem:e.issystem,issecurity:e.issecurity,appkey:e.appkey,role:e.role,doubleToken:{accessToken:{tokenContent:e.token,expires:e.expire},refreshToken:{tokenContent:e.refresh,expires:e.expire}}});const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=4e3?qe():setTimeout(qe,n-4e3))}function le(e){M.User&&(M.User.doubleToken=e);const t=new Date().getTime(),n=new Date(e.accessToken.expires).getTime()-t;if(n>0&&M.User){let i=bt();if(!i){const o=M.User.doubleToken;i={id:M.User.id,name:M.User.name,token:o?o.accessToken.tokenContent:"",expire:o?o.accessToken.expires:"",refresh:o?o.accessToken.tokenContent:"",issystem:M.User.issystem,issecurity:M.User.issecurity,appkey:M.User.appkey,role:M.User.role}}i.token=e.accessToken.tokenContent,i.expire=e.accessToken.expires,i.refresh=e.refreshToken.tokenContent,pt.set(ii,i,n/1e3),oi(i)}else pt.remove(ii)}function Ge(e){M.User=e}const Pt=M.Config.ServiceURL.LoginAuthURL;async function us(e){const t=(await at(Ct.Login,Pt,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),le(t.resultValue.doubleToken)),t}async function ls(e){const t=(await at(Ct.CheckLogin,Pt,e))?.data;return t&&t.isSuccess&&(Ge(t.resultValue),le(t.resultValue.doubleToken)),t}function hs(e){return at(Ct.ChangePWD,Pt,e)}function ds(){const e=bt();e&&(Le(Ct.Logout,Pt,{token:e.token,reftoken:e.refresh}),_e())}function fs(e){return at(Ct.CheckToken,Pt,{token:e})}const Xe="ROLE_SYSTEM_RIGHT",Ve=new $t("",sessionStorage);function ri(){return Ve.get(Xe)}function si(e){Ve.set(Xe,e)}function ai(){Ve.remove(Xe)}const Ke=[],Ye=[],Je=[];function Tt(){return ri()}async function ps(e,t,n,i){if(ai(),!M.User)return;let o;if(i)o=i;else{if(!t)return;let s=n;s||(s=M.Config.ServiceURL.LoginAuthURL);const g=await at(t,s,{system:e});if(!g||!g.data)return void M.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");o=g.data}return o&&si(o),o}function ci(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(i=>{const o=e.children?.find(s=>s.path===i.path);if(o){const s=ci(o,i);s&&n.children?.push(s)}})),n}function ms(e){if(M.User?.issystem)return e;const t=Tt();return t&&t.routes?(Je.length>0||e.forEach(n=>{const i=t.routes?.find(o=>o.name===n.name);if(i){const o=ci(n,i);o&&Je.push(o)}}),Je):void 0}function ui(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(i=>{const o=e.children?.find(s=>s.name===i.name);if(o){const s=ui(o,i);s&&n.children?.push(s)}})),n}function gs(e){if(M.User?.issystem)return e;const t=Tt();return t&&t.widgetMenu?(Ye.length>0||e.forEach(n=>{const i=t.widgetMenu?.find(o=>o.name===n.name);if(i){const o=ui(n,i);o&&Ye.push(o)}}),Ye):void 0}function vs(e){if(M.User?.issystem)return e;const t=Tt();return t&&t.widgets?(Ke.length>0||e?.forEach(n=>{t.widgets?.find(i=>i.id===n.id)&&Ke.push(n)}),Ke):void 0}function ys(e){if(M.User?.issystem)return e;const t=Tt();return t?t.functions:void 0}export{ar as BigFileDownload,Gt as Download,To as DownloadByUrl,wt as EnumColor,M as Global,ss as GlobalHprose,It as GlobalMitt,ot as H5Tool,At as HproseClient,Po as HttpDownload,Rn as JsonDownload,ae as LayoutContainer,q as LayoutContainerEnum,rs as LayoutManager,_r as ObjToUrlParams,Se as Pane,Rt as ProxyClient,Do as SaveAs,yo as Splitpanes,$t as Storage,Ft as StringUtils,Gr as StyleBlack,Kr as StyleGrayblue,Vr as StyleMetal,Xr as StyleWhite,K as SysEvents,as as TOKEN_REFRESH_TIME,Ct as USER_TOKEN_API,Qt as VCollapsiblePanel,Zt as VCollapsiblePanelGroup,se as VWindow,ei as WindowResizeEvent,Yr as WindowType,Ro as calculateBestTextColor,hs as changePWD,oi as checkDoRefreshToken,ls as checkLogin,fs as checkToken,_e as clearLocalToken,ai as clearRight,_o as colorIsDark,Jo as createFileUpload,Mo as darken,qn as deepMerge,qe as doRefreshToken,Gn as exportSystemRights,No as get,Tt as getCurrentSystemRight,Oo as getData,ys as getFunctions,Co as getHexColor,bt as getLocalToken,nr as getLockState,ko as getLongHexColor,Un as getProxyClient,xo as getRGBColor,zo as getRGBColorFromHSLA,Tn as getRefreshToken,ri as getRight,ms as getRoutes,ps as getSystemRoleRight,vs as getWidgetConfig,gs as getWidgetMenus,ke as hexToRGB,tr as init,er as initDefaultProxyClient,J as is,Hn as isArray,fr as isAsyncFunction,mr as isBoolean,gr as isClient,hr as isDate,$n as isDef,yr as isElement,Sr as isEmpty,Eo as isEnumColor,Cr as isError,Kt as isFunction,qt as isHexColor,br as isImageDom,zr as isMap,Oe as isNull,ur as isNullAndUnDef,lr as isNullOrUnDef,dr as isNumber,St as isObject,pr as isPromise,wr as isServer,Yt as isString,Er as isSymbol,Ue as isUnDef,Ir as isValidURL,kr as isWeakMap,xr as isWeakSet,vr as isWindow,Zo as jquery,Lo as lighten,us as login,ds as logout,So as newGuid,ir as onLockListener,Uo as post,at as requestGet,Le as requestPost,Bo as requestPostBody,Io as rgbToHex,le as setLocalToken,si as setRight,Ge as setUser,Ao as sleep,bo as storage,pt as storageHelper,or as unLockListener,Ht as uuid,Lr as writeIconifyList,Rr as writeSysRoleRight};