dengjunjie
2025-07-09 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922
1
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-23b4e563"],{"06d5":function(e,t,n){"use strict";n("afee")},"24f5":function(e,t,n){},"417f":function(e,t,n){"use strict";n("fd76")},"4a89":function(e,t,n){},"5d9b":function(e,t,n){"use strict";var o=n("c1b7");const r={class:"vol-el-menu"};function s(e,t,n,s,i,c){const a=Object(o["resolveComponent"])("vol-element-menu-child"),l=Object(o["resolveComponent"])("el-sub-menu"),h=Object(o["resolveComponent"])("el-menu-item"),d=Object(o["resolveComponent"])("el-menu");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",r,[Object(o["createVNode"])(d,{close:"vol-el-menu--vertical","default-openeds":e.openedIds,"default-active":e.defaultActive,"unique-opened":!0,onSelect:e.select,collapse:e.isCollapse,onOpen:e.handleOpen,onClose:e.handleClose,onContextmenu:Object(o["withModifiers"])(e.bindRightClickMenu,["prevent"])},{default:Object(o["withCtx"])(()=>[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.convertTree(e.list),t=>(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[!t.children.length||e.enable&&1!=t.enable?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:1},[e.enable&&1!=t.enable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(h,{class:"menu-item-lv1",key:t.id,index:""+t.id},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("i",{class:Object(o["normalizeClass"])(t.icon)},null,2),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(t.name),1)]),_:2},1032,["index"]))],64)):(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:t.id,index:""+t.id},{title:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("i",{class:Object(o["normalizeClass"])(["menu-icon",t.icon])},null,2),Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(t.name),1)]),default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(a,{enable:e.enable,list:t.children},null,8,["enable","list"])]),_:2},1032,["index"]))],64))),256))]),_:1},8,["default-openeds","default-active","onSelect","collapse","onOpen","onClose","onContextmenu"])])}n("5948");const i={class:"vol-el-menu-item"};function c(e,t,n,r,s,c){const a=Object(o["resolveComponent"])("el-menu-item"),l=Object(o["resolveComponent"])("vol-element-menu-child",!0),h=Object(o["resolveComponent"])("el-sub-menu");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",i,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(n.list,e=>(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[e.children&&e.children.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[e.children.length||n.enable&&1!=e.enable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:e.id,index:""+e.id},{title:Object(o["withCtx"])(()=>t[0]||(t[0]=[])),default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.name),1)]),_:2},1032,["index"])),!e.children.length||n.enable&&1!=e.enable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(h,{key:e.id,index:""+e.id},{title:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.name),1)]),default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(l,{enable:n.enable,list:e.children},null,8,["enable","list"])]),_:2},1032,["index"]))],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:1},[n.enable&&1!=e.enable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:e.id,index:""+e.id},{title:Object(o["withCtx"])(()=>t[1]||(t[1]=[])),default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.name),1)]),_:2},1032,["index"]))],64))],64))),256))])}var a={name:"vol-element-menu-child",props:{list:{type:Array,default:[]},enable:{type:Boolean,default:!1}}},l=(n("67fa"),n("9c21")),h=n.n(l);const d=h()(a,[["render",c],["__scopeId","data-v-4b9b70e0"]]);var u=d,g=n("1654"),p=Object(o["defineComponent"])({components:{"vol-element-menu-child":u},props:{enable:{type:Boolean,default:!1},isCollapse:{type:Boolean,default:!1},onSelect:{type:Function,default:e=>{}},openSelect:{type:Boolean,default:!0},list:{type:Array,default:[]},rootId:{type:String,default:"0"},currentMenuId:{type:Number,default:0}},setup(e){const t=(e,n,o)=>{n.children||(n.children=[]),o.forEach(r=>{r.parentId!=e||n.children.some(e=>e.id===r.id)||(n.children.push(r),t(r.id,r,o))})};let n=isNaN(e.rootId)?e.rootId:~~e.rootId;e.list.forEach(e=>{e.icon&&"el-"==e.icon.substring(0,3)||(e.icon="el-icon-menu"),e.children=[],e.isRoot=e.parentId===n});const r=e=>{var o=[];return e.forEach(r=>{r.parentId===n&&(r.hasOwnProperty("enable")||(r.enable=1),o.push(r),t(r.id,r,e))}),o},s=Object(o["reactive"])([e.currentMenuId]),i=Object(o["ref"])(e.currentMenuId+"");let c=Object(o["getCurrentInstance"])().appContext.config.globalProperties.base;Object(o["watch"])(()=>e.currentMenuId,(t,n)=>{i.value=t+"",s.splice(0),s.push(...c.getTreeAllParent(t,e.list).map(e=>e.id))});const a=Object(g["c"])();let l=!1;const h=(t,n)=>{if(l)return;l=!0,setTimeout(()=>{l=!1},20);let o=e.list.find(e=>e.id==t);e.onSelect(t,o),a.push({path:o.path||""})},d=(t,n)=>{e.openSelect&&h(t,n)},u=()=>{},p=e=>{};return{select:h,convertTree:r,handleOpen:d,handleClose:u,bindRightClickMenu:p,openedIds:s,defaultActive:i}}});n("417f");const b=h()(p,[["render",s],["__scopeId","data-v-136350ba"]]);t["a"]=b},"67fa":function(e,t,n){"use strict";n("4a89")},"6ab9":function(e,t,n){},7552:function(e,t,n){"use strict";n("8b9e")},"8b9e":function(e,t,n){},"97bb":function(e,t,n){},afee:function(e,t,n){},ba4e:function(e,t,n){"use strict";(function(e,o){n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return a})),n.d(t,"f",(function(){return l})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return u})),n.d(t,"e",(function(){return g})),n.d(t,"d",(function(){return p})),n.d(t,"b",(function(){return b})),n.d(t,"i",(function(){return _})),n.d(t,"g",(function(){return y})),n.d(t,"h",(function(){return C}));var r=n("f4b9"),s=n("f109");const i="6.0.25";class c{static isRequired(e,t){if(null===e||void 0===e)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,n){if(!(e in t))throw new Error(`Unknown ${n} value: ${e}.`)}}class a{static get isBrowser(){return"object"===typeof window&&"object"===typeof window.document}static get isWebWorker(){return"object"===typeof self&&"importScripts"in self}static get isReactNative(){return"object"===typeof window&&"undefined"===typeof window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function l(e,t){let n="";return d(e)?(n="Binary data of length "+e.byteLength,t&&(n+=`. Content: '${h(e)}'`)):"string"===typeof e&&(n="String data of length "+e.length,t&&(n+=`. Content: '${e}'`)),n}function h(e){const t=new Uint8Array(e);let n="";return t.forEach(e=>{const t=e<16?"0":"";n+=`0x${t}${e.toString(16)} `}),n.substr(0,n.length-1)}function d(e){return e&&"undefined"!==typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}async function u(e,t,n,o,s,i,c){let a={};if(s){const e=await s();e&&(a={["Authorization"]:"Bearer "+e})}const[h,u]=_();a[h]=u,e.log(r["a"].Trace,`(${t} transport) sending data. ${l(i,c.logMessageContent)}.`);const g=d(i)?"arraybuffer":"text",p=await n.post(o,{content:i,headers:{...a,...c.headers},responseType:g,timeout:c.timeout,withCredentials:c.withCredentials});e.log(r["a"].Trace,`(${t} transport) request complete. Response status: ${p.statusCode}.`)}function g(e){return void 0===e?new b(r["a"].Information):null===e?s["a"].instance:void 0!==e.log?e:new b(e)}class p{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(e=>{})}}class b{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const n=`[${(new Date).toISOString()}] ${r["a"][e]}: ${t}`;switch(e){case r["a"].Critical:case r["a"].Error:this.out.error(n);break;case r["a"].Warning:this.out.warn(n);break;case r["a"].Information:this.out.info(n);break;default:this.out.log(n);break}}}}function _(){let e="X-SignalR-User-Agent";return a.isNode&&(e="User-Agent"),[e,m(i,f(),w(),v())]}function m(e,t,n,o){let r="Microsoft SignalR/";const s=e.split(".");return r+=`${s[0]}.${s[1]}`,r+=` (${e}; `,r+=t&&""!==t?t+"; ":"Unknown OS; ",r+=""+n,r+=o?"; "+o:"; Unknown Runtime Version",r+=")",r}function f(){if(!a.isNode)return"";switch(e.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return e.platform}}function v(){if(a.isNode)return e.versions.node}function w(){return a.isNode?"NodeJS":"Browser"}function y(e){return e.stack?e.stack:e.message?e.message:""+e}function C(){if("undefined"!==typeof globalThis)return globalThis;if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof o)return o;throw new Error("could not find global")}}).call(this,n("0743"),n("a282"))},c0e4:function(e,t,n){"use strict";n("24f5")},c76c:function(e,t,n){e.exports=n.p+"img/wcs_logo.a2e26a60.png"},d504:function(e,t,n){"use strict";n.r(t);var o=n("c1b7");const r=["src"],s={class:"vol-menu"},i={class:"version-number",style:{"text-align":"center",padding:"10px 0",color:"#888","font-size":"16px"}},c={class:"vol-header"},a={class:"header-info"},l={class:"h-link"},h=["onClick"],d=["src","onerror"],u={class:"user"},g={class:"settings"},p={class:"vol-path"},b={style:{display:"none"}},_={class:"vol-main",id:"vol-main"},m={class:"theme-selector"},f=["onClick"];function v(e,t,n,v,w,y){const C=Object(o["resolveComponent"])("VolMenu"),j=Object(o["resolveComponent"])("el-scrollbar"),k=Object(o["resolveComponent"])("el-tab-pane"),O=Object(o["resolveComponent"])("el-tabs"),S=Object(o["resolveComponent"])("el-button"),E=Object(o["resolveComponent"])("loading"),T=Object(o["resolveComponent"])("router-view"),I=Object(o["resolveComponent"])("el-drawer"),x=Object(o["resolveComponent"])("Message");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{id:"vol-container",class:Object(o["normalizeClass"])(["vol-theme-"+e.theme])},[Object(o["createElementVNode"])("div",{class:"vol-aside",style:Object(o["normalizeStyle"])({width:e.menuWidth+"px"})},[Object(o["createElementVNode"])("div",{class:"header",style:Object(o["normalizeStyle"])({width:e.menuWidth-1+"px"})},[Object(o["withDirectives"])(Object(o["createElementVNode"])("img",{src:e.logo},null,8,r),[[o["vShow"],!e.isCollapse]]),Object(o["createElementVNode"])("i",{onClick:t[0]||(t[0]=(...t)=>e.toggleLeft&&e.toggleLeft(...t)),class:"el-icon-s-fold collapse-menu"})],4),Object(o["createElementVNode"])("div",s,[Object(o["createVNode"])(j,{style:{height:"100%"}},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(C,{currentMenuId:e.currentMenuId,"on-select":e.onSelect,enable:!0,"open-select":!1,isCollapse:e.isCollapse,list:e.menuOptions},null,8,["currentMenuId","on-select","isCollapse","list"])]),_:1}),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",i,t[10]||(t[10]=[Object(o["createTextVNode"])(" 版本:05.17.01"),Object(o["createElementVNode"])("br",null,null,-1),Object(o["createTextVNode"])(" 三一机器人版权所有"),Object(o["createElementVNode"])("br",null,null,-1)]),512),[[o["vShow"],!e.isCollapse]])])],4),Object(o["createElementVNode"])("div",{class:"vol-container",style:Object(o["normalizeStyle"])({left:e.menuWidth-1+"px"})},[Object(o["createElementVNode"])("div",c,[t[12]||(t[12]=Object(o["createElementVNode"])("div",{class:"project-name"},"WCS",-1)),t[13]||(t[13]=Object(o["createElementVNode"])("div",{class:"header-text"},null,-1)),Object(o["createElementVNode"])("div",a,[Object(o["createElementVNode"])("div",l,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.links.filter(e=>e.icon),(t,n)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{href:"javascript:void(0)",onClick:n=>e.to(t),key:n},[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(t.text),1)],8,h))),128))]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("img",{class:"user-header",src:e.userImg,onerror:e.errorImg},null,8,d)]),Object(o["createElementVNode"])("div",u,[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.userName),1),t[11]||(t[11]=Object(o["createElementVNode"])("span",{id:"index-date"},null,-1))]),Object(o["createElementVNode"])("div",g,[Object(o["createElementVNode"])("i",{style:{"font-size":"20px"},class:"el-icon-s-tools",onClick:t[1]||(t[1]=t=>e.drawer_model=!0)})])])]),Object(o["createElementVNode"])("div",p,[Object(o["createVNode"])(O,{onTabClick:e.selectNav,onTabRemove:e.removeNav,onContextmenu:t[2]||(t[2]=Object(o["withModifiers"])(t=>e.bindRightClickMenu(!1),["prevent"])),type:"border-card",class:"header-navigation",modelValue:e.selectId,"onUpdate:modelValue":t[3]||(t[3]=t=>e.selectId=t),strtch:!1},{default:Object(o["withCtx"])(()=>[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.navigation,(e,t)=>(Object(o["openBlock"])(),Object(o["createBlock"])(k,{type:"card",name:t+"",closable:t>0,key:t,label:e.name},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("span",b,Object(o["toDisplayString"])(t),1)]),_:2},1032,["name","closable","label"]))),128))]),_:1},8,["onTabClick","onTabRemove","modelValue"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("ul",{style:Object(o["normalizeStyle"])({left:e.menuLeft+"px",top:e.menuTop+"px"}),class:"contextMenu"},[Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createVNode"])(S,{link:"",onClick:t[4]||(t[4]=t=>e.closeTabs())},{default:Object(o["withCtx"])(()=>[t[14]||(t[14]=Object(o["createElementVNode"])("i",{class:"el-icon-close"},null,-1)),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(2==e.navigation.length?"关闭菜单":"关闭所有"),1)]),_:1})],512),[[o["vShow"],e.visibleItem.all]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createVNode"])(S,{link:"",onClick:t[5]||(t[5]=t=>e.closeTabs("left"))},{default:Object(o["withCtx"])(()=>t[15]||(t[15]=[Object(o["createElementVNode"])("i",{class:"el-icon-back"},null,-1),Object(o["createTextVNode"])("关闭左边")])),_:1})],512),[[o["vShow"],e.visibleItem.left]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createVNode"])(S,{link:"",onClick:t[6]||(t[6]=t=>e.closeTabs("right"))},{default:Object(o["withCtx"])(()=>t[16]||(t[16]=[Object(o["createElementVNode"])("i",{class:"el-icon-right"},null,-1),Object(o["createTextVNode"])("关闭右边")])),_:1})],512),[[o["vShow"],e.visibleItem.right]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("li",null,[Object(o["createVNode"])(S,{link:"",onClick:t[7]||(t[7]=t=>e.closeTabs("other"))},{default:Object(o["withCtx"])(()=>t[17]||(t[17]=[Object(o["createElementVNode"])("i",{class:"el-icon-right"},null,-1),Object(o["createTextVNode"])("关闭其他 ")])),_:1})],512),[[o["vShow"],e.visibleItem.other]])],4)],512),[[o["vShow"],e.contextMenuVisible]])]),Object(o["createElementVNode"])("div",_,[e.permissionInited?(Object(o["openBlock"])(),Object(o["createBlock"])(j,{key:0,style:{height:"100%"}},{default:Object(o["withCtx"])(()=>[Object(o["withDirectives"])(Object(o["createVNode"])(E,null,null,512),[[o["vShow"],e.$store.getters.isLoading()]]),Object(o["createVNode"])(T,null,{default:Object(o["withCtx"])(({Component:t})=>[(Object(o["openBlock"])(),Object(o["createBlock"])(o["KeepAlive"],null,[!e.$route.meta||e.$route.meta&&!e.$route.meta.hasOwnProperty("keepAlive")?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(t),{key:e.$route.name})):Object(o["createCommentVNode"])("",!0)],1024)),e.$route.meta&&e.$route.meta.hasOwnProperty("keepAlive")?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(t),{key:e.$route.name})):Object(o["createCommentVNode"])("",!0)]),_:1})]),_:1})):Object(o["createCommentVNode"])("",!0)])],4),Object(o["createVNode"])(I,{title:"选择主题",modelValue:e.drawer_model,"onUpdate:modelValue":t[8]||(t[8]=t=>e.drawer_model=t),direction:"rtl","destroy-on-close":""},{default:Object(o["withCtx"])(()=>[Object(o["createElementVNode"])("div",m,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.theme_color,(n,r)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{onClick:t=>e.changeTheme(n.name),class:"item",key:r,style:Object(o["normalizeStyle"])({background:n.color})},[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{style:Object(o["normalizeStyle"])([{background:n.leftColor},{height:"100%",width:"20px"}]),class:"t-left"},null,4),[[o["vShow"],n.leftColor]]),t[18]||(t[18]=Object(o["createElementVNode"])("div",{class:"t-right"},null,-1))],12,f))),128))])]),_:1},8,["modelValue"]),Object(o["createVNode"])(I,{title:"消息列表",modelValue:e.messageModel,"onUpdate:modelValue":t[9]||(t[9]=t=>e.messageModel=t),direction:"rtl","destroy-on-close":""},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(x,{list:e.messageList},null,8,["list"])]),_:1},8,["modelValue"])],2)}n("5948");const w={class:"router-loading",style:{background:"#eeeeee5c"}};function y(e,t,n,r,s,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",w,t[0]||(t[0]=[Object(o["createElementVNode"])("div",{class:"spanner"},[Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span"),Object(o["createElementVNode"])("span")],-1)]))}var C={data(){return{}}},j=(n("7552"),n("9c21")),k=n.n(j);const O=k()(C,[["render",y],["__scopeId","data-v-62dbee2c"]]);var S=O,E=n("5d9b");const T={class:"message-container"},I={class:"title"},x={class:"content"};function N(e,t,n,r,s,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(n.list,(e,t)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"item",key:t},[Object(o["createElementVNode"])("div",I,Object(o["toDisplayString"])(e.title)+"("+Object(o["toDisplayString"])(e.date)+")",1),Object(o["createElementVNode"])("div",x,Object(o["toDisplayString"])(e.message),1)]))),128))])}var P={props:{list:{type:Array,default:()=>[]}},created(){this.list.length||this.list.push({title:"消息测试标题",message:"消息测试内容消息测试内容消息测试内容消息测试内容",date:"2022-05-02 03:10"})}};n("06d5");const D=k()(P,[["render",N],["__scopeId","data-v-b15d9d92"]]);var $=D;const R=[0,2e3,1e4,3e4,null];class V{constructor(e){this._retryDelays=void 0!==e?[...e,null]:R}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class B extends Error{constructor(e,t){const n=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=n}}class M extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class H extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class A extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=n}}class L extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=n}}class W extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=n}}class F extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class q extends Error{constructor(e,t){const n=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=n}}class U{constructor(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}class z{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})}getCookieString(e){return""}}var J,K,X=n("f4b9"),Q=n("ba4e");class G extends z{constructor(e){if(super(),this._logger=e,"undefined"===typeof fetch){const e=require;this._jar=new(e("tough-cookie").CookieJar),this._fetchType=e("node-fetch"),this._fetchType=e("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Object(Q["h"])());if("undefined"===typeof AbortController){const e=require;this._abortControllerType=e("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new H;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let n;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),n=new H});let o,r=null;if(e.timeout){const o=e.timeout;r=setTimeout(()=>{t.abort(),this._logger.log(X["a"].Warning,"Timeout from HTTP request."),n=new M},o)}try{o=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"Content-Type":"text/plain;charset=UTF-8","X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(c){if(n)throw n;throw this._logger.log(X["a"].Warning,`Error from HTTP request. ${c}.`),c}finally{r&&clearTimeout(r),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const e=await Y(o,"text");throw new B(e||o.statusText,o.status)}const s=Y(o,e.responseType),i=await s;return new U(o.status,o.statusText,i)}getCookieString(e){let t="";return Q["c"].isNode&&this._jar&&this._jar.getCookies(e,(e,n)=>t=n.join("; ")),t}}function Y(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":n=e.text();break;case"blob":case"document":case"json":throw new Error(t+" is not supported.");default:n=e.text();break}return n}class Z extends z{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new H):e.method?e.url?new Promise((t,n)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=void 0===e.withCredentials||e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");const r=e.headers;r&&Object.keys(r).forEach(e=>{o.setRequestHeader(e,r[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),n(new H)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?t(new U(o.status,o.statusText,o.response||o.responseText)):n(new B(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(X["a"].Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),n(new B(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(X["a"].Warning,"Timeout from HTTP request."),n(new M)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class ee extends z{constructor(e){if(super(),"undefined"!==typeof fetch||Q["c"].isNode)this._httpClient=new G(e);else{if("undefined"===typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new Z(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new H):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class te{}te.Authorization="Authorization",te.Cookie="Cookie",function(e){e[e["None"]=0]="None",e[e["WebSockets"]=1]="WebSockets",e[e["ServerSentEvents"]=2]="ServerSentEvents",e[e["LongPolling"]=4]="LongPolling"}(J||(J={})),function(e){e[e["Text"]=1]="Text",e[e["Binary"]=2]="Binary"}(K||(K={}));class ne{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class oe{constructor(e,t,n,o){this._httpClient=e,this._accessTokenFactory=t,this._logger=n,this._pollAbort=new ne,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(e,t){if(Q["a"].isRequired(e,"url"),Q["a"].isRequired(t,"transferFormat"),Q["a"].isIn(t,K,"transferFormat"),this._url=e,this._logger.log(X["a"].Trace,"(LongPolling transport) Connecting."),t===K.Binary&&"undefined"!==typeof XMLHttpRequest&&"string"!==typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[n,o]=Object(Q["i"])(),r={[n]:o,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:r,timeout:1e5,withCredentials:this._options.withCredentials};t===K.Binary&&(s.responseType="arraybuffer");const i=await this._getAccessToken();this._updateHeaderToken(s,i);const c=`${e}&_=${Date.now()}`;this._logger.log(X["a"].Trace,`(LongPolling transport) polling: ${c}.`);const a=await this._httpClient.get(c,s);200!==a.statusCode?(this._logger.log(X["a"].Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new B(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _getAccessToken(){return this._accessTokenFactory?await this._accessTokenFactory():null}_updateHeaderToken(e,t){e.headers||(e.headers={}),t?e.headers[te.Authorization]="Bearer "+t:e.headers[te.Authorization]&&delete e.headers[te.Authorization]}async _poll(e,t){try{while(this._running){const o=await this._getAccessToken();this._updateHeaderToken(t,o);try{const n=`${e}&_=${Date.now()}`;this._logger.log(X["a"].Trace,`(LongPolling transport) polling: ${n}.`);const o=await this._httpClient.get(n,t);204===o.statusCode?(this._logger.log(X["a"].Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==o.statusCode?(this._logger.log(X["a"].Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new B(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(X["a"].Trace,`(LongPolling transport) data received. ${Object(Q["f"])(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(X["a"].Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(n){this._running?n instanceof M?this._logger.log(X["a"].Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=n,this._running=!1):this._logger.log(X["a"].Trace,"(LongPolling transport) Poll errored after shutdown: "+n.message)}}}finally{this._logger.log(X["a"].Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?Object(Q["k"])(this._logger,"LongPolling",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(X["a"].Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(X["a"].Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,n]=Object(Q["i"])();e[t]=n;const o={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},r=await this._getAccessToken();this._updateHeaderToken(o,r),await this._httpClient.delete(this._url,o),this._logger.log(X["a"].Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(X["a"].Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(X["a"].Trace,e),this.onclose(this._closeError)}}}class re{constructor(e,t,n,o){this._httpClient=e,this._accessTokenFactory=t,this._logger=n,this._options=o,this.onreceive=null,this.onclose=null}async connect(e,t){if(Q["a"].isRequired(e,"url"),Q["a"].isRequired(t,"transferFormat"),Q["a"].isIn(t,K,"transferFormat"),this._logger.log(X["a"].Trace,"(SSE transport) Connecting."),this._url=e,this._accessTokenFactory){const t=await this._accessTokenFactory();t&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(t))}return new Promise((n,o)=>{let r,s=!1;if(t===K.Text){if(Q["c"].isBrowser||Q["c"].isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),n={};n.Cookie=t;const[o,s]=Object(Q["i"])();n[o]=s,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...n,...this._options.headers}})}try{r.onmessage=e=>{if(this.onreceive)try{this._logger.log(X["a"].Trace,`(SSE transport) data received. ${Object(Q["f"])(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(t){return void this._close(t)}},r.onerror=e=>{s?this._close():o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this._logger.log(X["a"].Information,"SSE connected to "+this._url),this._eventSource=r,s=!0,n()}}catch(i){return void o(i)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?Object(Q["k"])(this._logger,"SSE",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class se{constructor(e,t,n,o,r,s){this._logger=n,this._accessTokenFactory=t,this._logMessageContent=o,this._webSocketConstructor=r,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,t){if(Q["a"].isRequired(e,"url"),Q["a"].isRequired(t,"transferFormat"),Q["a"].isIn(t,K,"transferFormat"),this._logger.log(X["a"].Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory){const t=await this._accessTokenFactory();t&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(t))}return new Promise((n,o)=>{let r;e=e.replace(/^http/,"ws");const s=this._httpClient.getCookieString(e);let i=!1;if(Q["c"].isNode){const t={},[n,o]=Object(Q["i"])();t[n]=o,s&&(t[te.Cookie]=""+s),r=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}r||(r=new this._webSocketConstructor(e)),t===K.Binary&&(r.binaryType="arraybuffer"),r.onopen=t=>{this._logger.log(X["a"].Information,`WebSocket connected to ${e}.`),this._webSocket=r,i=!0,n()},r.onerror=e=>{let t=null;t="undefined"!==typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(X["a"].Information,`(WebSockets transport) ${t}.`)},r.onmessage=e=>{if(this._logger.log(X["a"].Trace,`(WebSockets transport) data received. ${Object(Q["f"])(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(t){return void this._close(t)}},r.onclose=e=>{if(i)this._close(e);else{let t=null;t="undefined"!==typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",o(new Error(t))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(X["a"].Trace,`(WebSockets transport) sending data. ${Object(Q["f"])(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(X["a"].Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"===typeof e.wasClean&&"number"===typeof e.code}}const ie=100;class ce{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Q["a"].isRequired(e,"url"),this._logger=Object(Q["e"])(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!==typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout;let n=null,o=null;if(Q["c"].isNode){const e=require;n=e("ws"),o=e("eventsource")}Q["c"].isNode||"undefined"===typeof WebSocket||t.WebSocket?Q["c"].isNode&&!t.WebSocket&&n&&(t.WebSocket=n):t.WebSocket=WebSocket,Q["c"].isNode||"undefined"===typeof EventSource||t.EventSource?Q["c"].isNode&&!t.EventSource&&"undefined"!==typeof o&&(t.EventSource=o):t.EventSource=EventSource,this._httpClient=t.httpClient||new ee(this._logger),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||K.Binary,Q["a"].isIn(e,K,"transferFormat"),this._logger.log(X["a"].Debug,`Starting connection with transfer format '${K[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(X["a"].Error,e),await this._stopPromise,Promise.reject(new Error(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(X["a"].Error,e),Promise.reject(new Error(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new le(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(X["a"].Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(X["a"].Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(e=>{this._stopPromiseResolver=e}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(t){}if(this.transport){try{await this.transport.stop()}catch(t){this._logger.log(X["a"].Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(X["a"].Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==J.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(J.WebSockets),await this._startTransport(t,e)}else{let n=null,o=0;do{if(n=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new Error("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(n.url&&(t=n.url),n.accessToken){const e=n.accessToken;this._accessTokenFactory=()=>e}o++}while(n.url&&o<ie);if(o===ie&&n.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,n,e)}this.transport instanceof oe&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(X["a"].Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(n){return this._logger.log(X["a"].Error,"Failed to start the connection: "+n),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(n)}}async _getNegotiationResponse(e){const t={};if(this._accessTokenFactory){const e=await this._accessTokenFactory();e&&(t[te.Authorization]="Bearer "+e)}const[n,o]=Object(Q["i"])();t[n]=o;const r=this._resolveNegotiateUrl(e);this._logger.log(X["a"].Debug,`Sending negotiation request: ${r}.`);try{const e=await this._httpClient.post(r,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const n=JSON.parse(e.content);return(!n.negotiateVersion||n.negotiateVersion<1)&&(n.connectionToken=n.connectionId),n}catch(s){let e="Failed to complete negotiation with the server: "+s;return s instanceof B&&404===s.statusCode&&(e+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(X["a"].Error,e),Promise.reject(new F(e))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+"id="+t:e}async _createTransport(e,t,n,o){let r=this._createConnectUrl(e,n.connectionToken);if(this._isITransport(t))return this._logger.log(X["a"].Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(r,o),void(this.connectionId=n.connectionId);const s=[],i=n.availableTransports||[];let c=n;for(const a of i){const n=this._resolveTransportOrError(a,t,o);if(n instanceof Error)s.push(a.transport+" failed:"),s.push(n);else if(this._isITransport(n)){if(this.transport=n,!c){try{c=await this._getNegotiationResponse(e)}catch(ex){return Promise.reject(ex)}r=this._createConnectUrl(e,c.connectionToken)}try{return await this._startTransport(r,o),void(this.connectionId=c.connectionId)}catch(ex){if(this._logger.log(X["a"].Error,`Failed to start the transport '${a.transport}': ${ex}`),c=void 0,s.push(new W(`${a.transport} failed: ${ex}`,J[a.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(X["a"].Debug,e),Promise.reject(new Error(e))}}}}return s.length>0?Promise.reject(new q("Unable to connect to the server with any of the available transports. "+s.join(" "),s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case J.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new se(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case J.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new re(this._httpClient,this._accessTokenFactory,this._logger,this._options);case J.LongPolling:return new oe(this._httpClient,this._accessTokenFactory,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,n){const o=J[e.transport];if(null===o||void 0===o)return this._logger.log(X["a"].Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!ae(t,o))return this._logger.log(X["a"].Debug,`Skipping transport '${J[o]}' because it was disabled by the client.`),new L(`'${J[o]}' is disabled by the client.`,o);{const t=e.transferFormats.map(e=>K[e]);if(!(t.indexOf(n)>=0))return this._logger.log(X["a"].Debug,`Skipping transport '${J[o]}' because it does not support the requested transfer format '${K[n]}'.`),new Error(`'${J[o]}' does not support ${K[n]}.`);if(o===J.WebSockets&&!this._options.WebSocket||o===J.ServerSentEvents&&!this._options.EventSource)return this._logger.log(X["a"].Debug,`Skipping transport '${J[o]}' because it is not supported in your environment.'`),new A(`'${J[o]}' is not supported in your environment.`,o);this._logger.log(X["a"].Debug,`Selecting transport '${J[o]}'.`);try{return this._constructTransport(o)}catch(ex){return ex}}}_isITransport(e){return e&&"object"===typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(X["a"].Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(X["a"].Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(X["a"].Error,`Connection disconnected with error '${e}'.`):this._logger.log(X["a"].Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(e=>{this._logger.log(X["a"].Error,`TransportSendQueue.stop() threw error '${e}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(X["a"].Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(X["a"].Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!Q["c"].isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(X["a"].Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=e.indexOf("?");let n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t),-1===n.indexOf("negotiateVersion")&&(n+=-1===t?"?":"&",n+="negotiateVersion="+this._negotiateVersion),n}}function ae(e,t){return!e||0!==(t&e)}class le{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new he,this._transportResult=new he,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new he),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!==typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){while(1){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new he;const t=this._transportResult;this._transportResult=void 0;const n="string"===typeof this._buffer[0]?this._buffer.join(""):le._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(e){t.reject(e)}}}static _concatBuffers(e){const t=e.map(e=>e.byteLength).reduce((e,t)=>e+t),n=new Uint8Array(t);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return n.buffer}}class he{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class de{static write(e){return`${e}${de.RecordSeparator}`}static parse(e){if(e[e.length-1]!==de.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(de.RecordSeparator);return t.pop(),t}}de.RecordSeparatorCode=30,de.RecordSeparator=String.fromCharCode(de.RecordSeparatorCode);class ue{writeHandshakeRequest(e){return de.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,n;if(Object(Q["j"])(e)){const o=new Uint8Array(e),r=o.indexOf(de.RecordSeparatorCode);if(-1===r)throw new Error("Message is incomplete.");const s=r+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(o.slice(0,s))),n=o.byteLength>s?o.slice(s).buffer:null}else{const o=e,r=o.indexOf(de.RecordSeparator);if(-1===r)throw new Error("Message is incomplete.");const s=r+1;t=o.substring(0,s),n=o.length>s?o.substring(s):null}const o=de.parse(t),r=JSON.parse(o[0]);if(r.type)throw new Error("Expected a handshake response from the server.");const s=r;return[n,s]}}var ge;(function(e){e[e["Invocation"]=1]="Invocation",e[e["StreamItem"]=2]="StreamItem",e[e["Completion"]=3]="Completion",e[e["StreamInvocation"]=4]="StreamInvocation",e[e["CancelInvocation"]=5]="CancelInvocation",e[e["Ping"]=6]="Ping",e[e["Close"]=7]="Close"})(ge||(ge={}));class pe{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Q["d"](this,e)}}const be=3e4,_e=15e3;var me;(function(e){e["Disconnected"]="Disconnected",e["Connecting"]="Connecting",e["Connected"]="Connected",e["Disconnecting"]="Disconnecting",e["Reconnecting"]="Reconnecting"})(me||(me={}));class fe{constructor(e,t,n,o){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(X["a"].Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Q["a"].isRequired(e,"connection"),Q["a"].isRequired(t,"logger"),Q["a"].isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=be,this.keepAliveIntervalInMilliseconds=_e,this._logger=t,this._protocol=n,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new ue,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=me.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:ge.Ping})}static create(e,t,n,o){return new fe(e,t,n,o)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==me.Disconnected&&this._connectionState!==me.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==me.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=me.Connecting,this._logger.log(X["a"].Debug,"Starting HubConnection.");try{await this._startInternal(),Q["c"].isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=me.Connected,this._connectionStarted=!0,this._logger.log(X["a"].Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=me.Disconnected,this._logger.log(X["a"].Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t});await this.connection.start(this._protocol.transferFormat);try{const t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(X["a"].Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(X["a"].Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError}catch(t){throw this._logger.log(X["a"].Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(t),t}}async stop(){const e=this._startPromise;this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(t){}}_stopInternal(e){return this._connectionState===me.Disconnected?(this._logger.log(X["a"].Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===me.Disconnecting?(this._logger.log(X["a"].Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=me.Disconnecting,this._logger.log(X["a"].Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(X["a"].Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._createStreamInvocation(e,t,o);let s;const i=new pe;return i.cancelCallback=()=>{const e=this._createCancelInvocation(r.invocationId);return delete this._callbacks[r.invocationId],s.then(()=>this._sendWithProtocol(e))},this._callbacks[r.invocationId]=(e,t)=>{t?i.error(t):e&&(e.type===ge.Completion?e.error?i.error(new Error(e.error)):i.complete():i.next(e.item))},s=this._sendWithProtocol(r).catch(e=>{i.error(e),delete this._callbacks[r.invocationId]}),this._launchStreams(n,s),i}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._sendWithProtocol(this._createInvocation(e,t,!0,o));return this._launchStreams(n,r),r}invoke(e,...t){const[n,o]=this._replaceStreamingParams(t),r=this._createInvocation(e,t,!1,o),s=new Promise((e,t)=>{this._callbacks[r.invocationId]=(n,o)=>{o?t(o):n&&(n.type===ge.Completion?n.error?t(new Error(n.error)):e(n.result):t(new Error("Unexpected message type: "+n.type)))};const o=this._sendWithProtocol(r).catch(e=>{t(e),delete this._callbacks[r.invocationId]});this._launchStreams(n,o)});return s}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const n=this._methods[e];if(n)if(t){const o=n.indexOf(t);-1!==o&&(n.splice(o,1),0===n.length&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const e of n)switch(e.type){case ge.Invocation:this._invokeClientMethod(e);break;case ge.StreamItem:case ge.Completion:{const n=this._callbacks[e.invocationId];if(n){e.type===ge.Completion&&delete this._callbacks[e.invocationId];try{n(e)}catch(t){this._logger.log(X["a"].Error,"Stream callback threw error: "+Object(Q["g"])(t))}}break}case ge.Ping:break;case ge.Close:{this._logger.log(X["a"].Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect?this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}default:this._logger.log(X["a"].Warning,`Invalid message type: ${e.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,n;try{[n,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(o){const e="Error parsing handshake response: "+o;this._logger.log(X["a"].Error,e);const t=new Error(e);throw this._handshakeRejecter(t),t}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(X["a"].Error,e);const n=new Error(e);throw this._handshakeRejecter(n),n}return this._logger.log(X["a"].Debug,"Server handshake complete."),this._handshakeResolver(),n}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),void 0===this._pingServerHandle)){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===me.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){const t=this._methods[e.target.toLowerCase()];if(t){try{t.forEach(t=>t.apply(this,e.arguments))}catch(n){this._logger.log(X["a"].Error,`A callback for the method ${e.target.toLowerCase()} threw error '${n}'.`)}if(e.invocationId){const e="Server requested a response, which is not supported in this version of the client.";this._logger.log(X["a"].Error,e),this._stopPromise=this._stopInternal(new Error(e))}}else this._logger.log(X["a"].Warning,`No client method with the name '${e.target}' found.`)}_connectionClosed(e){this._logger.log(X["a"].Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===me.Disconnecting?this._completeClose(e):this._connectionState===me.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===me.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=me.Disconnected,this._connectionStarted=!1,Q["c"].isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(X["a"].Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let n=0,o=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),r=this._getNextRetryDelay(n++,0,o);if(null===r)return this._logger.log(X["a"].Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=me.Reconnecting,e?this._logger.log(X["a"].Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(X["a"].Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach(t=>t.apply(this,[e]))}catch(s){this._logger.log(X["a"].Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==me.Reconnecting)return void this._logger.log(X["a"].Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}while(null!==r){if(this._logger.log(X["a"].Information,`Reconnect attempt number ${n} will start in ${r} ms.`),await new Promise(e=>{this._reconnectDelayHandle=setTimeout(e,r)}),this._reconnectDelayHandle=void 0,this._connectionState!==me.Reconnecting)return void this._logger.log(X["a"].Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=me.Connected,this._logger.log(X["a"].Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach(e=>e.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(X["a"].Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(X["a"].Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==me.Reconnecting)return this._logger.log(X["a"].Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===me.Disconnecting&&this._completeClose());o=s instanceof Error?s:new Error(s.toString()),r=this._getNextRetryDelay(n++,Date.now()-t,o)}}this._logger.log(X["a"].Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${n} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,n){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:n})}catch(o){return this._logger.log(X["a"].Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${o}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach(n=>{const o=t[n];try{o(null,e)}catch(r){this._logger.log(X["a"].Error,`Stream 'error' callback called with '${e}' threw error: ${Object(Q["g"])(r)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,n,o){if(n)return 0!==o.length?{arguments:t,streamIds:o,target:e,type:ge.Invocation}:{arguments:t,target:e,type:ge.Invocation};{const n=this._invocationId;return this._invocationId++,0!==o.length?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:ge.Invocation}:{arguments:t,invocationId:n.toString(),target:e,type:ge.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const n in e)e[n].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n)))},error:e=>{let o;o=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(n,o)))},next:e=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(n,e)))}})}}_replaceStreamingParams(e){const t=[],n=[];for(let o=0;o<e.length;o++){const r=e[o];if(this._isObservable(r)){const s=this._invocationId;this._invocationId++,t[s]=r,n.push(s.toString()),e.splice(o,1)}}return[t,n]}_isObservable(e){return e&&e.subscribe&&"function"===typeof e.subscribe}_createStreamInvocation(e,t,n){const o=this._invocationId;return this._invocationId++,0!==n.length?{arguments:t,invocationId:o.toString(),streamIds:n,target:e,type:ge.StreamInvocation}:{arguments:t,invocationId:o.toString(),target:e,type:ge.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:ge.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:ge.StreamItem}}_createCompletionMessage(e,t,n){return t?{error:t,invocationId:e,type:ge.Completion}:{invocationId:e,result:n,type:ge.Completion}}}var ve=n("f109");const we="json";class ye{constructor(){this.name=we,this.version=1,this.transferFormat=K.Text}parseMessages(e,t){if("string"!==typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=ve["a"].instance);const n=de.parse(e),o=[];for(const r of n){const e=JSON.parse(r);if("number"!==typeof e.type)throw new Error("Invalid payload.");switch(e.type){case ge.Invocation:this._isInvocationMessage(e);break;case ge.StreamItem:this._isStreamItemMessage(e);break;case ge.Completion:this._isCompletionMessage(e);break;case ge.Ping:break;case ge.Close:break;default:t.log(X["a"].Information,"Unknown message type '"+e.type+"' ignored.");continue}o.push(e)}return o}writeMessage(e){return de.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if("string"!==typeof e||""===e)throw new Error(t)}}const Ce={trace:X["a"].Trace,debug:X["a"].Debug,info:X["a"].Information,information:X["a"].Information,warn:X["a"].Warning,warning:X["a"].Warning,error:X["a"].Error,critical:X["a"].Critical,none:X["a"].None};function je(e){const t=Ce[e.toLowerCase()];if("undefined"!==typeof t)return t;throw new Error("Unknown log level: "+e)}class ke{configureLogging(e){if(Q["a"].isRequired(e,"logging"),Oe(e))this.logger=e;else if("string"===typeof e){const t=je(e);this.logger=new Q["b"](t)}else this.logger=new Q["b"](e);return this}withUrl(e,t){return Q["a"].isRequired(e,"url"),Q["a"].isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions="object"===typeof t?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return Q["a"].isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new V(e):this.reconnectPolicy=e:this.reconnectPolicy=new V,this}build(){const e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new ce(this.url,e);return fe.create(t,this.logger||ve["a"].instance,this.protocol||new ye,this.reconnectPolicy)}}function Oe(e){return void 0!==e.log}var Se,Ee,Te=n("42c8"),Ie=function(e,t){let n;e.post("api/User/GetCurrentUserInfo").then(o=>{n=(new ke).withAutomaticReconnect().withUrl(`${e.ipAddress}message?userName=${o.data.userName}`).build(),n.start().catch(e=>console.log(ex.message)),n.onreconnected(e=>{console.log(e)}),n.on("ReceiveHomePageMessage",(function(e){console.log(e),Te["a"].success({title:e.title,message:e.message+"",type:"info"}),t&&t(e)}))})},xe=n("1654"),Ne=n("4360"),Pe=n("c1fb"),De=n("c76c"),$e=Object(o["defineComponent"])({components:{VolMenu:E["a"],loading:S,Message:$},data(){return{allTabs:!0,leftTabs:!0,rightTabs:!0,otherTabs:!0,menuLeft:0,menuTop:0}},setup(e,t){const{proxy:r}=Object(o["getCurrentInstance"])(),s=Object(o["ref"])(200),i=Object(o["ref"])(!1),c=Object(o["ref"])(!1),a=Object(o["ref"])(!1),l=Object(o["ref"])(!1),h=Object(o["ref"])([{name:"blue",color:"rgb(45, 140, 240)"},{name:"blue2",color:"rgb(45, 140, 240)",leftColor:"#0068d6"},{name:"red",color:"rgb(237, 64, 20)"},{name:"red2",color:"rgb(237, 64, 20)",leftColor:"#a90000"},{name:"dark",color:"#272929"},{name:"orange",color:"#ff9900"},{name:"orange2",color:"#ff9900",leftColor:"rgb(232 141 5)"},{name:"green",color:"rgb(25, 190, 107)"},{name:"green2",color:"rgb(25, 190, 107)",leftColor:"#019e4f"},{name:"white",color:"#fff"}]),d=Object(o["ref"])([{text:"个人中心",path:"/UserInfo",id:-1,icon:"el-icon-s-custom"},{text:"安全退出",path:"/login",id:-4,icon:"el-icon-switch-button"}]),u=Object(o["ref"])('this.src="'+n("731d")+'"'),g=Object(o["ref"])("1"),p=Object(o["ref"])("0"),b=Object(o["ref"])(0),_=Object(o["ref"])("--"),m=Object(o["ref"])({}),f=Object(o["reactive"])({left:!1,right:!1,all:!1,other:!1}),v=Object(o["ref"])(""),w=Object(o["reactive"])([{orderNo:"0",id:"1",name:"首页",path:"/home"}]),y=Object(o["ref"])(De),C=Object(o["ref"])("blue2"),j=Object(o["ref"])([]),k=Object(o["ref"])(!1),O=Object(o["reactive"])([]);let S=Object(o["getCurrentInstance"])().appContext.config.globalProperties,E=Object(xe["c"])();const T=()=>{c.value=!c.value,s.value=c.value?63:200};S.menu={show(){T()},hide(){T()}};const I=e=>{C.value!=e&&(C.value=e),localStorage.setItem("vol3_theme",e)},x=e=>{if(-1==e.path.indexOf("http"))return"string"==typeof e||"/login"==e.path?"/login"==e||"/login"==e.path?(Ne["a"].commit("clearUserInfo",""),void(window.location.href="/")):void E.push({path:e}):void("#"!=e.path&&N(e));window.open(e.path)},N=(e,t)=>{let n=w.findIndex(t=>t.path==e.path);-1==n?(w.push({id:e.id+"",name:e.name||e.text||"无标题",path:e.path,query:e.query}),g.value=w.length-1+""):g.value=n+"",void 0===t&&(D(e),E.push(e)),b.value=1*e.id,r.$nextTick((function(e){r.bindRightClickMenu(!0)}))},P=e=>{let t=w.findIndex(t=>t.path==e);if(-1==t)return S.$Message.error("未找到菜单");V(t)},D=e=>{localStorage.setItem(window.location.origin+"_tabs",JSON.stringify(e))},$=()=>{let e=localStorage.getItem(window.location.origin+"_tabs");return e?JSON.parse(e):null},R=e=>{g.value=e.props.name;let t=w[e.index].path;b.value=(j.value.find(e=>e.path==t)||{id:0}).id,E.push({path:w[e.index].path,query:w[e.index].query})},V=e=>new Promise(()=>{if(g.value==e+"")return console.log(w[e-1]),D(w[e-1]),E.push({path:w[e-1].path,query:w[e-1].query}),w.splice(e,1),void(g.value=g.value-1+"");e<g.value&&(g.value=g.value-1+""),w.splice(e,1),b.value=(j.value.find(e=>e.path==w[1*g.value].path)||{id:0}).id}),B=e=>j.value.find((function(t){return t.id==e})),M=e=>{var t=B(e);N(t,!1)},H=function(e){e.preventDefault();let t=1*e.target.id.split("-")[1];p.value=1*document.getElementById("pane-"+t).children[0].textContent,1!=w.length&&(p.value?(f.all=!0,f.right=p.value!=w.length-1,f.left=2!=w.length,f.other=2!=w.length):(f.all=!1,f.right=!0,f.left=!1,f.other=!1),i.value=!0,r.menuLeft=e.target.getBoundingClientRect().left-(c.value?63:198),r.menuTop=36)},A=()=>{i.value=!1},L=()=>{N({text:w[0].name,path:w[0].path})},W=e=>{let t=w[1*g.value].id,n=1*g.value;switch(e){case"left":w.splice(1,n-1);break;case"right":0==p.value?(w.splice(n),L()):(w.splice(n+1),p.value<n&&w.splice(p.value,n-p.value));break;case"other":w.splice(n+1),w.splice(1,n-1);break;default:w.splice(1,w.length),L();break}g.value=w.findIndex(e=>e.id==t)+"",A()};Object(o["watch"])(()=>i.value,(e,t)=>{e?document.body.addEventListener("click",A):document.body.removeEventListener("click",A)});const F=()=>{let e=localStorage.getItem("vol3_theme");e&&(C.value=e);let t=Ne["a"].getters.getUserInfo();t&&(_.value=t.userName,t.img&&(v.value=S.base.getImgSrc(t.img,Pe["a"].ipAddress))),Object.assign(S.$tabs,{open:N,close:P}),Pe["a"].get("api/Sys_Menu/getTreeMenu",{},!0).then(e=>{if(e.push({id:"1",name:"首页",url:"/home"}),e.forEach(e=>{e.path=(e.url||"").replace("/Manager",""),e.to=(e.url||"").replace("/Manager",""),e.icon&&"el-"==e.icon.substring(0,3)||(e.icon="el-icon-menu")}),Ne["a"].dispatch("setPermission",e),j.value=e,k.value=!0,S.$global.signalR&&Ie(Pe["a"],e=>{O.unshift(e)}),E.currentRoute.value.path!=w[0].path){let e=j.value.find(e=>e.path==E.currentRoute.value.path);if(e)return M(e.id);if(e=d.value.find(e=>e.path==E.currentRoute.value.path),e||(e=$()),e)return N(e,!1)}g.value="1"})};return F(),{menuWidth:s,isCollapse:c,drawer_model:a,theme_color:h,errorImg:u,userInfo:m,userName:_,userImg:v,selectId:g,selectMenuIndex:p,navigation:w,links:d,onSelect:M,openTabsMenu:H,selectNav:R,getSelectMenuName:B,removeNav:V,logo:y,theme:C,menuOptions:j,permissionInited:k,changeTheme:I,to:x,toggleLeft:T,messageModel:l,messageList:O,contextMenuVisible:i,visibleItem:f,closeTabsMenu:A,closeTabs:W,currentMenuId:b}},mounted(){let e=Ve();Ee=document.getElementById("index-date"),Ee.innerText=e,Se=setInterval((function(){Ee.innerText=Ve()}),1e3),this.bindRightClickMenu(!0)},methods:{bindRightClickMenu(e){if(!e)return;let t=this;t.$nextTick(()=>{let e=Object.assign([],document.getElementsByClassName("el-tabs__item is-top"));e.forEach((e,n)=>{e.oncontextmenu=t.openTabsMenu})})}},destroyed(){null,clearInterval(Se)}});const Re=new Array("星期一","星期二","星期三","星期四","星期五","星期六","星期日");function Ve(){let e=new Date,t=e.getFullYear(),n=e.getMonth()+1,o=e.getDate(),r=e.getHours(),s=e.getMinutes(),i=e.getSeconds();return t+"."+(n<10?"0"+n:n)+"."+(o<10?"0"+o:o)+" "+(r<10?"0"+r:r)+":"+(s<10?"0"+s:s)+":"+(i<10?"0"+i:i)+" "+(Re[e.getDay()-1]||Re[6])}n("fcc8"),n("d8ef"),n("c0e4");const Be=k()($e,[["render",v],["__scopeId","data-v-61644c4b"]]);t["default"]=Be},d8ef:function(e,t,n){"use strict";n("97bb")},f109:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(){}log(e,t){}}o.instance=new o},f4b9:function(e,t,n){"use strict";var o;n.d(t,"a",(function(){return o})),function(e){e[e["Trace"]=0]="Trace",e[e["Debug"]=1]="Debug",e[e["Information"]=2]="Information",e[e["Warning"]=3]="Warning",e[e["Error"]=4]="Error",e[e["Critical"]=5]="Critical",e[e["None"]=6]="None"}(o||(o={}))},fcc8:function(e,t,n){"use strict";n("6ab9")},fd76:function(e,t,n){}}]);