openc3-cosmos-tool-limitsmonitor 6.4.1 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/tools/limitsmonitor/{ArrayWidget-CeyoPOhk-49a7956e836ef3d2d777.js → ArrayWidget-D0fKsdTb-aac5fddd29131e534d70.js} +2 -2
- data/tools/limitsmonitor/{ArrayplotWidget-BEw4fJPY-32d542d1de4dec68d602.js → ArrayplotWidget-BmRSuGhA-4104c64c475786bf86be.js} +1 -1
- data/tools/limitsmonitor/{BarColumn-CIWppEH6-339606934f00f22985c8.js → BarColumn-DtYw6Gmq-b569445e54c502e14dd0.js} +1 -1
- data/tools/limitsmonitor/{BlockWidget-DRtBkPat-4bc95214899b3dec6e1f.js → BlockWidget-Dpxbw455-32212adbb0893386a59c.js} +2 -2
- data/tools/limitsmonitor/{ButtonWidget-4GORf9BG-6bfaafb323896a93549d.js → ButtonWidget-8iOpXmpp-40a970c24dc2695352f0.js} +1 -1
- data/tools/limitsmonitor/CanvasWidget-B0iU38rA-15fd06c0a6c703c0115b.js +1 -0
- data/tools/limitsmonitor/{CanvasdotWidget-unc83V9l-4444daac8926950ff71c.js → CanvasdotWidget-C9viSVBs-cdadcb450fe8cd0a907d.js} +1 -1
- data/tools/limitsmonitor/{CanvasimageWidget-CNPV5Ale-5fc8230d67fd99f0cb0d.js → CanvasimageWidget-CFiCpITu-57d8d0cd44f80416e40c.js} +1 -1
- data/tools/limitsmonitor/{CanvasimagevalueWidget-DsQbSZt_-47fba85d9f33ab1a5ccf.js → CanvasimagevalueWidget-fu6vbAY0-b6d8bf71f4089aded670.js} +1 -1
- data/tools/limitsmonitor/CanvaslabelWidget-BVqHq3Vp-b83197f961cc872127c6.js +1 -0
- data/tools/limitsmonitor/{CanvaslabelvalueWidget-DX-b_55r-9f472a7e0a85ab397a95.js → CanvaslabelvalueWidget-BOFa8-NU-3e73d92f824260182fe7.js} +1 -1
- data/tools/limitsmonitor/{CanvaslineWidget-DiNWzbpu-c2cbd7546be2eb3b27eb.js → CanvaslineWidget-l3ko0QXk-137d16f4744aecaa7db1.js} +1 -1
- data/tools/limitsmonitor/{CanvaslinevalueWidget-Du9pwAN7-ea57690695583a333dc4.js → CanvaslinevalueWidget-BCZoO-Z6-214b2b51764935ee17fe.js} +1 -1
- data/tools/limitsmonitor/CheckbuttonWidget-BN7e1d5b-f2111e621a77849ac8a5.js +1 -0
- data/tools/limitsmonitor/ComboboxWidget-Bb5RGXDB-e234150f623c9a226077.js +1 -0
- data/tools/limitsmonitor/{DateWidget-BCmQNavZ-62e7e13b5b64aa349a15.js → DateWidget-Dggqab-F-f0d2af9a5dccbf3d364b.js} +1 -1
- data/tools/limitsmonitor/{DetailsDialog-OMd7LWdZ-69b51c5c190c9c3a2fbb.js → DetailsDialog-BhSAQDSK-82a31e992b2fdb7909da.js} +1 -1
- data/tools/limitsmonitor/{DynamicWidget-CfMtj7H8-c27538d69ff7c8f932ef.js → DynamicWidget-CfMtj7H8-efb1758f4bc5035eeac8.js} +1 -1
- data/tools/limitsmonitor/{FormatvalueWidget-CPn5mDHY-d5278aaeb56a5beae1f5.js → FormatvalueWidget-B9_PbzY2-185072cc9a885c54557a.js} +1 -1
- data/tools/limitsmonitor/{Graph-vUcIyyTp-6e5e4a8f6921228c0f41.js → Graph-B29y4d5A-510f21317ca29375ad20.js} +1 -1
- data/tools/limitsmonitor/{GraphWidget-Cl97QQYm-4abd20b0dd7da145644c.js → GraphWidget-oBxPa3EB-abfe80c94f92a49c1fbd.js} +1 -1
- data/tools/limitsmonitor/{HorizontalWidget-CtTkQHl--2bbc58728b68db3b56ec.js → HorizontalWidget-BWgZL_Oz-26b08260507693be27a8.js} +1 -1
- data/tools/limitsmonitor/HorizontalboxWidget-yMYUnNB8-3d0e2c84bab9ebf9d7b6.js +1 -0
- data/tools/limitsmonitor/HorizontallineWidget-C4zMx7z2-e17546a3f41e0511cf63.js +1 -0
- data/tools/limitsmonitor/{IframeWidget-BmZOip3U-d50c76a07bbfece3e06f.js → IframeWidget-DA4P_mJT-1334da8779453fe7d01f.js} +1 -1
- data/tools/limitsmonitor/{ImageLoader-wYNaGuuz-a42d9349bced54a8a095.js → ImageLoader-rvd9t-mk-26f860f989e5fbe5bf32.js} +1 -1
- data/tools/limitsmonitor/{ImageviewerWidget-ByuTqBHq-72179af55af2d4964d47.js → ImageviewerWidget-B1wK0hK4-6bb7fd9d9c49c3546d83.js} +1 -1
- data/tools/limitsmonitor/{LabelWidget-Dmb5F5j--9550b22f1c3e91e4d942.js → LabelWidget-CY0saBoK-1864ba30c9ea6e9c2726.js} +1 -1
- data/tools/limitsmonitor/LabelledWidget-B3ZOYaGy-e358ad65d9b6ffa0f55c.js +1 -0
- data/tools/limitsmonitor/LabelprogressbarWidget-CmXcESTg-f2d9119ccb9751b16a87.js +1 -0
- data/tools/limitsmonitor/{LabelsparklineWidget-BaoIdd7s-aabdf2cc3a02dc6d4922.js → LabelsparklineWidget-D_yrQrn6-7db86411c08d418d3963.js} +1 -1
- data/tools/limitsmonitor/LabelvalueWidget-dNaNfsBE-ec17c9cbbfaf82f87a6c.js +1 -0
- data/tools/limitsmonitor/{LabelvaluedescWidget-BBHwqvj4-280c1b7b61c59dd53498.js → LabelvaluedescWidget-3vNoH6Mc-1f98c34377c22e42f6b5.js} +1 -1
- data/tools/limitsmonitor/LabelvaluelimitsbarWidget-7VppYVIN-610c31ed2c371eea7a55.js +1 -0
- data/tools/limitsmonitor/LabelvaluelimitscolumnWidget-BZ6nwifg-d3b9fdbd9198017601b5.js +1 -0
- data/tools/limitsmonitor/{LabelvaluerangebarWidget-B83Jj5Q1-673d308391d47fd52445.js → LabelvaluerangebarWidget-IyuXLNsw-a86de4fb4d4d25a9789c.js} +1 -1
- data/tools/limitsmonitor/Layout-BqMhhhws-643aa0564a54baca8fa7.js +1 -0
- data/tools/limitsmonitor/{LedWidget-Cccb8YTk-3b970e6534567a488211.js → LedWidget-DSxpmIOK-d656c446decd7e551e31.js} +1 -1
- data/tools/limitsmonitor/{LimitsMonitor-fdfa02f6c9b699328615.js → LimitsMonitor-95609a7c55b9137e9e32.js} +7 -7
- data/tools/limitsmonitor/{LimitsbarWidget-D1EBBwX1-31eb44889597c88f13e9.js → LimitsbarWidget-BoPTdVV5-ad7d88fb6a43bd097fb4.js} +1 -1
- data/tools/limitsmonitor/{LimitscolorWidget--1aPSNVB-bb5a179dbb6bdf833803.js → LimitscolorWidget-Bt3qOvrv-2b61b4b74490127cfaea.js} +1 -1
- data/tools/limitsmonitor/{LimitscolumnWidget-swnMNApm-9435a6100a4d58a2e06d.js → LimitscolumnWidget-Ce6YnUBz-e468ec159cf181413fbc.js} +1 -1
- data/tools/limitsmonitor/{LinegraphWidget-BbI-wOnq-9bae8c7fa35ea9aa1fe1.js → LinegraphWidget-XAbg0jj2-6ceda7f7878b1b053c87.js} +1 -1
- data/tools/limitsmonitor/MatrixbycolumnsWidget-5MgJFZtz-eaf7a03a454bcc6d1af6.js +1 -0
- data/tools/limitsmonitor/{ProgressbarWidget-7rJeuX6H-bcd64df139f2a2d6dba9.js → ProgressbarWidget-CDwDOFIy-2c82bfe6661033f58be3.js} +1 -1
- data/tools/limitsmonitor/{RadiobuttonWidget-DsEw3JiU-6c496f6afb03a6cc1806.js → RadiobuttonWidget-cQ8V8LaD-494a4343d55d6426a4cd.js} +1 -1
- data/tools/limitsmonitor/RadiogroupWidget-BvRnuGA2-f974709308912338b061.js +1 -0
- data/tools/limitsmonitor/{RangebarWidget-BEGvSL_K-7ea1a70413d43e4717e9.js → RangebarWidget-aHmgV0qs-76fe04f109e44f0ce2fe.js} +1 -1
- data/tools/limitsmonitor/{RollupWidget-BZhspgWd-d59a8e7bf78c9f0ffeba.js → RollupWidget-D1jUPrUQ-80c473399fb8ff5509f1.js} +1 -1
- data/tools/limitsmonitor/{ScrollwindowWidget-qZ3nhhVU-3e63a407a6d9b7d0dc3f.js → ScrollwindowWidget-Cn0o3b4E-bd1987ac2c5e6cc518a7.js} +1 -1
- data/tools/limitsmonitor/{SignalWidget-Bh14Zrch-5569d60ec2e3a49e4338.js → SignalWidget-BQBzqdU--4f5d43838dadc5402eab.js} +1 -1
- data/tools/limitsmonitor/{SpacerWidget-D_NE46jZ-2ddb9121f287e03f4a6b.js → SpacerWidget-C0RmQY3t-2a1a5ef53bddf1b09edc.js} +1 -1
- data/tools/limitsmonitor/{SparklineWidget-CJEEJdZ--c4e191d98639502b513b.js → SparklineWidget-BTH9rvcX-fd8e615f4141010473c9.js} +1 -1
- data/tools/limitsmonitor/TabbookWidget-C-aDdEoD-708b620d584e481ded4f.js +1 -0
- data/tools/limitsmonitor/TextboxWidget-Dd2ccpUQ-33653af87cfe1fea7628.js +1 -0
- data/tools/limitsmonitor/TextfieldWidget-DY3aFTnP-eee001bf00c2c93859ab.js +1 -0
- data/tools/limitsmonitor/{TimeWidget-AFOTVB4w-660cd94ec12fd47a9764.js → TimeWidget-C_site21-7a9b17bbc5a1af3034ba.js} +1 -1
- data/tools/limitsmonitor/{TitleWidget-CbS_wrQw-b30141756cd06a0b4a50.js → TitleWidget-Bx81VfQD-817c56012f0ff9858ab2.js} +1 -1
- data/tools/limitsmonitor/{VWidget-BlF_o-7Z-8700b80d13746328280b.js → VWidget-DuUens7G-87104bd1deae5b485569.js} +1 -1
- data/tools/limitsmonitor/ValueWidget-cbjxVV3B-e076d61fa81401a7cc50.js +1 -0
- data/tools/limitsmonitor/ValuelimitsbarWidget-cQb2o_xH-3949564c9c48871674df.js +1 -0
- data/tools/limitsmonitor/{ValuelimitscolumnWidget-Bs91VFLz-e5a5717bcf8487164a7c.js → ValuelimitscolumnWidget-BBTuSCK9-75eb3a016f3cee79bb51.js} +1 -1
- data/tools/limitsmonitor/{ValuerangebarWidget-C7WHyR2h-eac2fd56e4c4b66dbdc1.js → ValuerangebarWidget-Ct7iGtu0-69b5a0fc7a81d3a8973e.js} +1 -1
- data/tools/limitsmonitor/{VerticalWidget-COP5oVCK-707bf0a4d5acdf764e5f.js → VerticalWidget-DJn02myf-348213c572b8581e4305.js} +1 -1
- data/tools/limitsmonitor/VerticalboxWidget-DHQMxtF3-5af4c370699d1eef74dc.js +1 -0
- data/tools/limitsmonitor/{Widget-cmJ76_g1-4aa75794b863048cf608.js → Widget-CP2CtyUr-def56573328955ef6837.js} +1 -1
- data/tools/limitsmonitor/{main-f10bcf343482e86c9af1.js → main-5202947b4013913d3b0b.js} +50 -50
- data/tools/limitsmonitor/main.js +1 -1
- metadata +68 -68
- data/tools/limitsmonitor/CanvasWidget-VW1uHIU0-88b68b259961bdf8ed1c.js +0 -1
- data/tools/limitsmonitor/CanvaslabelWidget-B-5KAkZr-60f18a4f8ec5881dfea8.js +0 -1
- data/tools/limitsmonitor/CheckbuttonWidget--QM-segm-4feb1ad7373b4a52d96f.js +0 -1
- data/tools/limitsmonitor/ComboboxWidget-BDpHIcCo-ece0f5b4b555c6783331.js +0 -1
- data/tools/limitsmonitor/HorizontalboxWidget-Dn9zVn4r-340efdda72f993e43ba1.js +0 -1
- data/tools/limitsmonitor/HorizontallineWidget-BBvYWaP7-e9dae87a7d2ae283a686.js +0 -1
- data/tools/limitsmonitor/LabelledWidget-DV1IbbPS-725eba9e2b32819f3147.js +0 -1
- data/tools/limitsmonitor/LabelprogressbarWidget-BHBDYVZp-9ec446d9004b9458554d.js +0 -1
- data/tools/limitsmonitor/LabelvalueWidget-wuW55zQP-cce880c585de6ecbbe17.js +0 -1
- data/tools/limitsmonitor/LabelvaluelimitsbarWidget-77Rc3lCf-999e447835aef9ee9097.js +0 -1
- data/tools/limitsmonitor/LabelvaluelimitscolumnWidget-nounrACl-45c35df76857f0abc433.js +0 -1
- data/tools/limitsmonitor/Layout-ByQC7nQ3-a3acebfb61141942ff41.js +0 -1
- data/tools/limitsmonitor/MatrixbycolumnsWidget-Bx2qMr8P-65dab944d132a86e636f.js +0 -1
- data/tools/limitsmonitor/RadiogroupWidget-DhfbTvQ8-7c70327b028c21076fad.js +0 -1
- data/tools/limitsmonitor/TabbookWidget-C-SU65IF-dd7bdf4e65508b1244dd.js +0 -1
- data/tools/limitsmonitor/TextboxWidget-Dn1Ds-b0-fc14be9cb5c1adabd605.js +0 -1
- data/tools/limitsmonitor/TextfieldWidget-C0C7NL53-66a4e092c0497b2d5d04.js +0 -1
- data/tools/limitsmonitor/ValueWidget-DFUfM5tw-900b81da5daea9a77bd5.js +0 -1
- data/tools/limitsmonitor/ValuelimitsbarWidget-CALgABsT-b4f66fc22e5faf5a6c2d.js +0 -1
- data/tools/limitsmonitor/VerticalboxWidget-CDPoOx4C-993e295c4c81cd266a7f.js +0 -1
@@ -1,8 +1,8 @@
|
|
1
|
-
System.register(["./main-
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(C);const vs={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(t){return t.replaceAll(" ","-").toLowerCase()},subMenuClick(t){t.command(t),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},Ss={class:"app-title mr-2"};function Es(t,e,s,n,r,i){const o=y("v-col"),a=y("v-row"),l=y("v-icon"),u=y("v-btn"),d=y("v-divider"),h=y("v-list-item-title"),b=y("v-list-item"),f=y("v-list"),w=y("v-menu"),p=y("v-radio"),I=y("v-list-item-action"),R=y("v-radio-group"),E=y("v-checkbox");return k(),N(ht,{to:"#openc3-menu"},[g(a,{"no-gutters":""},{default:m(()=>[g(o,{"align-self":"end"},{default:m(()=>[F("span",Ss,J(s.title),1)]),_:1})]),_:1}),g(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(k(!0),M(Z,null,ne(s.menus,(O,V)=>(k(),N(w,{ref_for:!0,ref:"topmenu",key:V},{activator:m(({props:_})=>[g(u,be({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:O.label,"data-test":i.formatDT(`${s.title} ${O.label}`)}),{append:m(()=>[g(l,{class:"menu-button-icon"},{default:m(()=>e[0]||(e[0]=[P(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),M(Z,null,ne(O.items,(_,j)=>(k(),M(Z,null,[_.divider?(k(),N(d,{key:j+"-divider"})):_.subMenu&&_.subMenu.length>0?(k(),M("div",{key:j+"-submenu"},[(k(),N(w,{"open-on-hover":"",location:"right",key:j},{activator:m(({props:T})=>[(k(),N(b,be({ref_for:!0},T,{disabled:_.disabled,key:j}),_e({append:m(()=>[g(l,null,{default:m(()=>e[1]||(e[1]=[P(" mdi-chevron-right ")])),_:1})]),default:m(()=>[!_.radio&&!_.checkbox?(k(),N(h,{key:0,style:Be("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[P(J(_.label),1)]),_:2},1032,["style"])):Y("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{disabled:_.disabled},{default:m(()=>[P(J(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),M(Z,null,ne(_.subMenu,(T,x)=>(k(),N(b,{key:x,"prepend-icon":T.icon,onClick:L=>i.subMenuClick(T)},{default:m(()=>[g(h,null,{default:m(()=>[P(J(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(k(),N(R,{"model-value":_.value,"onUpdate:modelValue":_.command,key:j+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:m(()=>[(k(!0),M(Z,null,ne(_.choices,(T,x)=>(k(),N(b,{key:x+"-choice"},{default:m(()=>[g(I,{class:"list-action"},{default:m(()=>[g(p,{color:"secondary",label:T.label,value:T.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(k(),N(b,{onClick:T=>_.command(_),disabled:_.disabled,"data-test":i.formatDT(`${s.title} ${O.label} ${_.label}`),key:j+"-list"},_e({default:m(()=>[_.checkbox?(k(),N(I,{key:0,class:"list-action"},{default:m(()=>[g(E,{modelValue:_.checked,"onUpdate:modelValue":T=>_.checked=T,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):Y("",!0),!_.radio&&!_.checkbox?(k(),N(h,{key:1,style:Be("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[P(J(_.label),1)]),_:2},1032,["style"])):Y("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const xs=ct(vs,[["render",Es],["__scopeId","data-v-4d454b93"]]);var Cs=Object.defineProperty,Os=(t,e,s)=>e in t?Cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,ye=(t,e,s)=>Os(t,typeof e!="symbol"?e+"":e,s);function mt(t,e){return function(){return t.apply(e,arguments)}}const{toString:ks}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:we,toStringTag:gt}=Symbol,ve=(t=>e=>{const s=ks.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),z=t=>(t=t.toLowerCase(),e=>ve(e)===t),Se=t=>e=>typeof e===t,{isArray:re}=Array,ce=Se("undefined");function Rs(t){return t!==null&&!ce(t)&&t.constructor!==null&&!ce(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const bt=z("ArrayBuffer");function Is(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&bt(t.buffer),e}const As=Se("string"),B=Se("function"),_t=Se("number"),Ee=t=>t!==null&&typeof t=="object",Ts=t=>t===!0||t===!1,xe=t=>{if(ve(t)!=="object")return!1;const e=qe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(gt in t)&&!(we in t)},Ls=z("Date"),Ns=z("File"),Ps=z("Blob"),js=z("FileList"),Us=t=>Ee(t)&&B(t.pipe),Ds=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||B(t.append)&&((e=ve(t))==="formdata"||e==="object"&&B(t.toString)&&t.toString()==="[object FormData]"))},Fs=z("URLSearchParams"),[Bs,$s,qs,Vs]=["ReadableStream","Request","Response","Headers"].map(z),Ms=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function le(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),re(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{const i=s?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(n=0;n<o;n++)a=i[n],e.call(null,t[a],a,t)}}function yt(t,e){e=e.toLowerCase();const s=Object.keys(t);let n=s.length,r;for(;n-- >0;)if(r=s[n],e===r.toLowerCase())return r;return null}const G=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wt=t=>!ce(t)&&t!==G;function Ve(){const{caseless:t}=wt(this)&&this||{},e={},s=(n,r)=>{const i=t&&yt(e,r)||r;xe(e[i])&&xe(n)?e[i]=Ve(e[i],n):xe(n)?e[i]=Ve({},n):re(n)?e[i]=n.slice():e[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&le(arguments[n],s);return e}const zs=(t,e,s,{allOwnKeys:n}={})=>(le(e,(r,i)=>{s&&B(r)?t[i]=mt(r,s):t[i]=r},{allOwnKeys:n}),t),Ws=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hs=(t,e,s,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},Js=(t,e,s,n)=>{let r,i,o;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=s!==!1&&qe(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ks=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const n=t.indexOf(e,s);return n!==-1&&n===s},Zs=t=>{if(!t)return null;if(re(t))return t;let e=t.length;if(!_t(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Ys=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qe(Uint8Array)),Gs=(t,e)=>{const s=(t&&t[we]).call(t);let n;for(;(n=s.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},Xs=(t,e)=>{let s;const n=[];for(;(s=t.exec(e))!==null;)n.push(s);return n},Qs=z("HTMLFormElement"),en=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),vt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),tn=z("RegExp"),St=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),n={};le(s,(r,i)=>{let o;(o=e(r,i,t))!==!1&&(n[i]=o||r)}),Object.defineProperties(t,n)},sn=t=>{St(t,(e,s)=>{if(B(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const n=t[s];if(B(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},nn=(t,e)=>{const s={},n=r=>{r.forEach(i=>{s[i]=!0})};return re(t)?n(t):n(String(t).split(e)),s},rn=()=>{},on=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function an(t){return!!(t&&B(t.append)&&t[gt]==="FormData"&&t[we])}const cn=t=>{const e=new Array(10),s=(n,r)=>{if(Ee(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const i=re(n)?[]:{};return le(n,(o,a)=>{const l=s(o,r+1);!ce(l)&&(i[a]=l)}),e[r]=void 0,i}}return n};return s(t,0)},ln=z("AsyncFunction"),un=t=>t&&(Ee(t)||B(t))&&B(t.then)&&B(t.catch),Et=((t,e)=>t?setImmediate:e?((s,n)=>(G.addEventListener("message",({source:r,data:i})=>{r===G&&i===s&&n.length&&n.shift()()},!1),r=>{n.push(r),G.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",B(G.postMessage)),dn=typeof queueMicrotask<"u"?queueMicrotask.bind(G):typeof process<"u"&&process.nextTick||Et,hn=t=>t!=null&&B(t[we]),c={isArray:re,isArrayBuffer:bt,isBuffer:Rs,isFormData:Ds,isArrayBufferView:Is,isString:As,isNumber:_t,isBoolean:Ts,isObject:Ee,isPlainObject:xe,isReadableStream:Bs,isRequest:$s,isResponse:qs,isHeaders:Vs,isUndefined:ce,isDate:Ls,isFile:Ns,isBlob:Ps,isRegExp:tn,isFunction:B,isStream:Us,isURLSearchParams:Fs,isTypedArray:Ys,isFileList:js,forEach:le,merge:Ve,extend:zs,trim:Ms,stripBOM:Ws,inherits:Hs,toFlatObject:Js,kindOf:ve,kindOfTest:z,endsWith:Ks,toArray:Zs,forEachEntry:Gs,matchAll:Xs,isHTMLForm:Qs,hasOwnProperty:vt,hasOwnProp:vt,reduceDescriptors:St,freezeMethods:sn,toObjectSet:nn,toCamelCase:en,noop:rn,toFiniteNumber:on,findKey:yt,global:G,isContextDefined:wt,isSpecCompliantForm:an,toJSONObject:cn,isAsyncFn:ln,isThenable:un,setImmediate:Et,asap:dn,isIterable:hn};function v(t,e,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}c.inherits(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=v.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ct[t]={value:t}}),Object.defineProperties(v,Ct),Object.defineProperty(xt,"isAxiosError",{value:!0}),v.from=(t,e,s,n,r,i)=>{const o=Object.create(xt);return c.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(o,t.message,e,s,n,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const fn=null;function Me(t){return c.isPlainObject(t)||c.isArray(t)}function Ot(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function kt(t,e,s){return t?t.concat(e).map(function(n,r){return n=Ot(n),!s&&r?"["+n+"]":n}).join(s?".":""):e}function pn(t){return c.isArray(t)&&!t.some(Me)}const mn=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Ce(t,e,s){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=c.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,w){return!c.isUndefined(w[f])});const n=s.metaTokens,r=s.visitor||u,i=s.dots,o=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(!a&&c.isBlob(f))throw new v("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,w,p){let I=f;if(f&&!p&&typeof f=="object"){if(c.endsWith(w,"{}"))w=n?w:w.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&pn(f)||(c.isFileList(f)||c.endsWith(w,"[]"))&&(I=c.toArray(f)))return w=Ot(w),I.forEach(function(R,E){!(c.isUndefined(R)||R===null)&&e.append(o===!0?kt([w],E,i):o===null?w:w+"[]",l(R))}),!1}return Me(f)?!0:(e.append(kt(p,w,i),l(f)),!1)}const d=[],h=Object.assign(mn,{defaultVisitor:u,convertValue:l,isVisitable:Me});function b(f,w){if(!c.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(f),c.forEach(f,function(p,I){(!(c.isUndefined(p)||p===null)&&r.call(e,p,c.isString(I)?I.trim():I,w,h))===!0&&b(p,w?w.concat(I):[I])}),d.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return b(t),e}function Rt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function ze(t,e){this._pairs=[],t&&Ce(t,this,e)}const It=ze.prototype;It.append=function(t,e){this._pairs.push([t,e])},It.toString=function(t){const e=t?function(s){return t.call(this,s,Rt)}:Rt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function gn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function At(t,e,s){if(!e)return t;const n=s&&s.encode||gn;c.isFunction(s)&&(s={serialize:s});const r=s&&s.serialize;let i;if(r?i=r(e,s):i=c.isURLSearchParams(e)?e.toString():new ze(e,s).toString(n),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Tt{constructor(){this.handlers=[]}use(e,s,n){return this.handlers.push({fulfilled:e,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bn=typeof URLSearchParams<"u"?URLSearchParams:ze,_n=typeof FormData<"u"?FormData:null,yn=typeof Blob<"u"?Blob:null,wn={isBrowser:!0,classes:{URLSearchParams:bn,FormData:_n,Blob:yn},protocols:["http","https","file","blob","url","data"]},We=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,vn=We&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),Sn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",En=We&&window.location.href||"http://localhost",xn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:We,hasStandardBrowserEnv:vn,hasStandardBrowserWebWorkerEnv:Sn,navigator:He,origin:En},Symbol.toStringTag,{value:"Module"})),D={...xn,...wn};function Cn(t,e){return Ce(t,new D.classes.URLSearchParams,Object.assign({visitor:function(s,n,r,i){return D.isNode&&c.isBuffer(s)?(this.append(n,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function On(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function kn(t){const e={},s=Object.keys(t);let n;const r=s.length;let i;for(n=0;n<r;n++)i=s[n],e[i]=t[i];return e}function Nt(t){function e(s,n,r,i){let o=s[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=s.length;return o=!o&&c.isArray(r)?r.length:o,l?(c.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):((!r[o]||!c.isObject(r[o]))&&(r[o]=[]),e(s,n,r[o],i)&&c.isArray(r[o])&&(r[o]=kn(r[o])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const s={};return c.forEachEntry(t,(n,r)=>{e(On(n),r,s,0)}),s}return null}function Rn(t,e,s){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(t)}const ue={transitional:Lt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=c.isObject(t);if(r&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return n?JSON.stringify(Nt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Cn(t,this.formSerializer).toString();if((i=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Ce(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Rn(t)):t}],transformResponse:[function(t){const e=this.transitional||ue.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(s&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(i){if(r)throw i.name==="SyntaxError"?v.from(i,v.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:D.classes.FormData,Blob:D.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{ue.headers[t]={}});const In=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),An=t=>{const e={};let s,n,r;return t&&t.split(`
|
3
|
-
`).forEach(function(i){r=i.indexOf(":"),s=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+1).trim(),!(!s||e[s]&&
|
4
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const e=(this[Pt]=this[Pt]={accessors:{}}).accessors,s=this.prototype;function n(r){const i=de(r);e[i]||(Pn(s,r),e[i]=!0)}return c.isArray(t)?t.forEach(n):n(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors($.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[s]=n}}}),c.freezeMethods($);function Ke(t,e){const s=this||ue,n=e||s,r=$.from(n.headers);let i=n.data;return c.forEach(t,function(o){i=o.call(s,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function jt(t){return!!(t&&t.__CANCEL__)}function ie(t,e,s){v.call(this,t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(ie,v,{__CANCEL__:!0});function Ut(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function jn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Un(t,e){t=t||10;const s=new Array(t),n=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),u=n[i];o||(o=l),s[r]=a,n[r]=l;let d=i,h=0;for(;d!==r;)h+=s[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),l-o<e)return;const b=u&&l-u;return b?Math.round(h*1e3/b):void 0}}function Dn(t,e){let s=0,n=1e3/e,r,i;const o=(a,l=Date.now())=>{s=l,r=null,i&&(clearTimeout(i),i=null),t.apply(null,a)};return[(...a)=>{const l=Date.now(),u=l-s;u>=n?o(a,l):(r=a,i||(i=setTimeout(()=>{i=null,o(r)},n-u)))},()=>r&&o(r)]}const ke=(t,e,s=3)=>{let n=0;const r=Un(50,250);return Dn(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-n,u=r(l),d=o<=a;n=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},s)},Dt=(t,e)=>{const s=t!=null;return[n=>e[0]({lengthComputable:s,total:t,loaded:n}),e[1]]},Ft=t=>(...e)=>c.asap(()=>t(...e)),Fn=D.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,D.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(D.origin),D.navigator&&/(msie|trident)/i.test(D.navigator.userAgent)):()=>!0,Bn=D.hasStandardBrowserEnv?{write(t,e,s,n,r,i){const o=[t+"="+encodeURIComponent(e)];c.isNumber(s)&&o.push("expires="+new Date(s).toGMTString()),c.isString(n)&&o.push("path="+n),c.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $n(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Bt(t,e,s){let n=!$n(e);return t&&(n||s==!1)?qn(t,e):e}const $t=t=>t instanceof $?{...t}:t;function X(t,e){e=e||{};const s={};function n(u,d,h,b){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:b},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function r(u,d,h,b){if(c.isUndefined(d)){if(!c.isUndefined(u))return n(void 0,u,h,b)}else return n(u,d,h,b)}function i(u,d){if(!c.isUndefined(d))return n(void 0,d)}function o(u,d){if(c.isUndefined(d)){if(!c.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function a(u,d,h){if(h in e)return n(u,d);if(h in t)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d,h)=>r($t(u),$t(d),h,!0)};return c.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=l[u]||r,h=d(t[u],e[u],u);c.isUndefined(h)&&d!==a||(s[u]=h)}),s}const qt=t=>{const e=X({},t);let{data:s,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=$.from(o),e.url=At(Bt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(c.isFormData(s)){if(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(D.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(e)),n||n!==!1&&Fn(e.url))){const u=r&&i&&Bn.read(i);u&&o.set(r,u)}return e},Vn=typeof XMLHttpRequest<"u",Mn=Vn&&function(t){return new Promise(function(e,s){const n=qt(t);let r=n.data;const i=$.from(n.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=n,u,d,h,b,f;function w(){b&&b(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout;function I(){if(!p)return;const E=$.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:E,config:t,request:p};Ut(function(V){e(V),w()},function(V){s(V),w()},O),p=null}"onloadend"in p?p.onloadend=I:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(I)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(){s(new v("Network Error",v.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let E=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const O=n.transitional||Lt;n.timeoutErrorMessage&&(E=n.timeoutErrorMessage),s(new v(E,O.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},r===void 0&&i.setContentType(null),"setRequestHeader"in p&&c.forEach(i.toJSON(),function(E,O){p.setRequestHeader(O,E)}),c.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),o&&o!=="json"&&(p.responseType=n.responseType),l&&([h,f]=ke(l,!0),p.addEventListener("progress",h)),a&&p.upload&&([d,b]=ke(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(n.cancelToken||n.signal)&&(u=E=>{p&&(s(!E||E.type?new ie(null,t,p):E),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const R=jn(n.url);if(R&&D.protocols.indexOf(R)===-1){s(new v("Unsupported protocol "+R+":",v.ERR_BAD_REQUEST,t));return}p.send(r||null)})},zn=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let n=new AbortController,r;const i=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;n.abort(d instanceof v?d:new ie(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=n;return l.unsubscribe=()=>c.asap(a),l}},Wn=function*(t,e){let s=t.byteLength;if(s<e){yield t;return}let n=0,r;for(;n<s;)r=n+e,yield t.slice(n,r),n=r},Hn=async function*(t,e){for await(const s of Jn(t))yield*Wn(s,e)},Jn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:s,value:n}=await e.read();if(s)break;yield n}}finally{await e.cancel()}},Vt=(t,e,s,n)=>{const r=Hn(t,e);let i=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await r.next();if(u){a(),l.close();return}let h=d.byteLength;if(s){let b=i+=h;s(b)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},Re=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Mt=Re&&typeof ReadableStream=="function",Kn=Re&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),zt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Zn=Mt&&zt(()=>{let t=!1;const e=new Request(D.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Wt=64*1024,Ze=Mt&&zt(()=>c.isReadableStream(new Response("").body)),Ie={stream:Ze&&(t=>t.body)};Re&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ie[e]&&(Ie[e]=c.isFunction(t[e])?s=>s[e]():(s,n)=>{throw new v(`Response type '${e}' is not supported`,v.ERR_NOT_SUPPORT,n)})})})(new Response);const Yn=async t=>{if(t==null)return 0;if(c.isBlob(t))return t.size;if(c.isSpecCompliantForm(t))return(await new Request(D.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(c.isArrayBufferView(t)||c.isArrayBuffer(t))return t.byteLength;if(c.isURLSearchParams(t)&&(t=t+""),c.isString(t))return(await Kn(t)).byteLength},Gn=async(t,e)=>c.toFiniteNumber(t.getContentLength())??Yn(e),Xn=Re&&(async t=>{let{url:e,method:s,data:n,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:b}=qt(t);u=u?(u+"").toLowerCase():"text";let f=zn([r,i&&i.toAbortSignal()],o),w;const p=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let I;try{if(l&&Zn&&s!=="get"&&s!=="head"&&(I=await Gn(d,n))!==0){let _=new Request(e,{method:"POST",body:n,duplex:"half"}),j;if(c.isFormData(n)&&(j=_.headers.get("content-type"))&&d.setContentType(j),_.body){const[T,x]=Dt(I,ke(Ft(l)));n=Vt(_.body,Wt,T,x)}}c.isString(h)||(h=h?"include":"omit");const R="credentials"in Request.prototype;w=new Request(e,{...b,signal:f,method:s.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:R?h:void 0});let E=await fetch(w);const O=Ze&&(u==="stream"||u==="response");if(Ze&&(a||O&&p)){const _={};["status","statusText","headers"].forEach(L=>{_[L]=E[L]});const j=c.toFiniteNumber(E.headers.get("content-length")),[T,x]=a&&Dt(j,ke(Ft(a),!0))||[];E=new Response(Vt(E.body,Wt,T,()=>{x&&x(),p&&p()}),_)}u=u||"text";let V=await Ie[c.findKey(Ie,u)||"text"](E,t);return!O&&p&&p(),await new Promise((_,j)=>{Ut(_,j,{data:V,headers:$.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:w})})}catch(R){throw p&&p(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,t,w),{cause:R.cause||R}):v.from(R,R&&R.code,t,w)}}),Ye={http:fn,xhr:Mn,fetch:Xn};c.forEach(Ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ht=t=>`- ${t}`,Qn=t=>c.isFunction(t)||t===null||t===!1,Jt={getAdapter:t=>{t=c.isArray(t)?t:[t];const{length:e}=t;let s,n;const r={};for(let i=0;i<e;i++){s=t[i];let o;if(n=s,!Qn(s)&&(n=Ye[(o=String(s)).toLowerCase()],n===void 0))throw new v(`Unknown adapter '${o}'`);if(n)break;r[o||"#"+i]=n}if(!n){const i=Object.entries(r).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
|
1
|
+
System.register(["./main-5202947b4013913d3b0b.js","vue","single-spa","./VWidget-DuUens7G-87104bd1deae5b485569.js","./ValueWidget-cbjxVV3B-e076d61fa81401a7cc50.js","./IframeWidget-DA4P_mJT-1334da8779453fe7d01f.js","./ValuelimitsbarWidget-cQb2o_xH-3949564c9c48871674df.js","vue-router","vuex","vuetify","./Widget-CP2CtyUr-def56573328955ef6837.js","./DetailsDialog-BhSAQDSK-82a31e992b2fdb7909da.js","./LimitsbarWidget-BoPTdVV5-ad7d88fb6a43bd097fb4.js","./BarColumn-DtYw6Gmq-b569445e54c502e14dd0.js"],function(ws,Ai){"use strict";var ct,ge,Fe,lt,ut,dt,y,N,k,ht,g,m,F,J,M,G,ne,P,be,_e,Y,$e,Be,ft,pt;return{setters:[C=>{ct=C.d,ge=C._,Fe=C.R,lt=C.N,ut=C.a,dt=C.v},C=>{y=C.resolveComponent,N=C.createBlock,k=C.openBlock,ht=C.Teleport,g=C.createVNode,m=C.withCtx,F=C.createElementVNode,J=C.toDisplayString,M=C.createElementBlock,G=C.Fragment,ne=C.renderList,P=C.createTextVNode,be=C.mergeProps,_e=C.createSlots,Y=C.createCommentVNode,$e=C.normalizeStyle,Be=C.normalizeClass},null,null,C=>{ft=C.default},null,C=>{pt=C.default},null,null,null,null,null,null,null],execute:function(){var C=document.createElement("style");C.textContent=`.footer[data-v-ed7ec5ac]{padding-top:5px}.v-input[data-v-ed7ec5ac]{background-color:var(--color-background-base-default)}.textfield-green[data-v-ed7ec5ac]{color:#00c800}.textfield-yellow[data-v-ed7ec5ac]{color:#ffdc00}.textfield-red[data-v-ed7ec5ac]{color:#ff2d2d}.limits-table[data-v-ed7ec5ac]{margin-top:5px;margin-bottom:10px}.limits-table[data-v-ed7ec5ac] th{font-weight:700;background-color:var(--color-background-base-default)}.card-height[data-v-210db24e]{height:calc(100vh - 150px)}
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(C);const vs={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(t){return t.replaceAll(" ","-").toLowerCase()},subMenuClick(t){t.command(t),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},Ss={class:"app-title mr-2"};function Es(t,e,s,n,r,i){const o=y("v-col"),a=y("v-row"),l=y("v-icon"),u=y("v-btn"),d=y("v-divider"),h=y("v-list-item-title"),b=y("v-list-item"),f=y("v-list"),w=y("v-menu"),p=y("v-radio"),A=y("v-list-item-action"),R=y("v-radio-group"),E=y("v-checkbox");return k(),N(ht,{to:"#openc3-menu"},[g(a,{"no-gutters":""},{default:m(()=>[g(o,{"align-self":"end"},{default:m(()=>[F("span",Ss,J(s.title),1)]),_:1})]),_:1}),g(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(k(!0),M(G,null,ne(s.menus,(O,V)=>(k(),N(w,{ref_for:!0,ref:"topmenu",key:V},{activator:m(({props:_})=>[g(u,be({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:O.label,"data-test":i.formatDT(`${s.title} ${O.label}`)}),{append:m(()=>[g(l,{class:"menu-button-icon"},{default:m(()=>e[0]||(e[0]=[P(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),M(G,null,ne(O.items,(_,j)=>(k(),M(G,null,[_.divider?(k(),N(d,{key:j+"-divider"})):_.subMenu&&_.subMenu.length>0?(k(),M("div",{key:j+"-submenu"},[(k(),N(w,{"open-on-hover":"",location:"right",key:j},{activator:m(({props:T})=>[(k(),N(b,be({ref_for:!0},T,{disabled:_.disabled,key:j}),_e({append:m(()=>[g(l,null,{default:m(()=>e[1]||(e[1]=[P(" mdi-chevron-right ")])),_:1})]),default:m(()=>[!_.radio&&!_.checkbox?(k(),N(h,{key:0,style:$e("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[P(J(_.label),1)]),_:2},1032,["style"])):Y("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{disabled:_.disabled},{default:m(()=>[P(J(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),M(G,null,ne(_.subMenu,(T,x)=>(k(),N(b,{key:x,"prepend-icon":T.icon,onClick:L=>i.subMenuClick(T)},{default:m(()=>[g(h,null,{default:m(()=>[P(J(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(k(),N(R,{"model-value":_.value,"onUpdate:modelValue":_.command,key:j+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:m(()=>[(k(!0),M(G,null,ne(_.choices,(T,x)=>(k(),N(b,{key:x+"-choice"},{default:m(()=>[g(A,{class:"list-action"},{default:m(()=>[g(p,{color:"secondary",label:T.label,value:T.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(k(),N(b,{onClick:T=>_.command(_),disabled:_.disabled,"data-test":i.formatDT(`${s.title} ${O.label} ${_.label}`),key:j+"-list"},_e({default:m(()=>[_.checkbox?(k(),N(A,{key:0,class:"list-action"},{default:m(()=>[g(E,{modelValue:_.checked,"onUpdate:modelValue":T=>_.checked=T,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):Y("",!0),!_.radio&&!_.checkbox?(k(),N(h,{key:1,style:$e("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[P(J(_.label),1)]),_:2},1032,["style"])):Y("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const xs=ct(vs,[["render",Es],["__scopeId","data-v-4d454b93"]]);var Cs=Object.defineProperty,Os=(t,e,s)=>e in t?Cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,ye=(t,e,s)=>Os(t,typeof e!="symbol"?e+"":e,s);function mt(t,e){return function(){return t.apply(e,arguments)}}const{toString:ks}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:we,toStringTag:gt}=Symbol,ve=(t=>e=>{const s=ks.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),z=t=>(t=t.toLowerCase(),e=>ve(e)===t),Se=t=>e=>typeof e===t,{isArray:re}=Array,ce=Se("undefined");function Rs(t){return t!==null&&!ce(t)&&t.constructor!==null&&!ce(t.constructor)&&$(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const bt=z("ArrayBuffer");function As(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&bt(t.buffer),e}const Is=Se("string"),$=Se("function"),_t=Se("number"),Ee=t=>t!==null&&typeof t=="object",Ts=t=>t===!0||t===!1,xe=t=>{if(ve(t)!=="object")return!1;const e=qe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(gt in t)&&!(we in t)},Ls=z("Date"),Ns=z("File"),Ps=z("Blob"),js=z("FileList"),Ds=t=>Ee(t)&&$(t.pipe),Us=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||$(t.append)&&((e=ve(t))==="formdata"||e==="object"&&$(t.toString)&&t.toString()==="[object FormData]"))},Fs=z("URLSearchParams"),[$s,Bs,qs,Vs]=["ReadableStream","Request","Response","Headers"].map(z),Ms=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function le(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),re(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{const i=s?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(n=0;n<o;n++)a=i[n],e.call(null,t[a],a,t)}}function yt(t,e){e=e.toLowerCase();const s=Object.keys(t);let n=s.length,r;for(;n-- >0;)if(r=s[n],e===r.toLowerCase())return r;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wt=t=>!ce(t)&&t!==Z;function Ve(){const{caseless:t}=wt(this)&&this||{},e={},s=(n,r)=>{const i=t&&yt(e,r)||r;xe(e[i])&&xe(n)?e[i]=Ve(e[i],n):xe(n)?e[i]=Ve({},n):re(n)?e[i]=n.slice():e[i]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&le(arguments[n],s);return e}const zs=(t,e,s,{allOwnKeys:n}={})=>(le(e,(r,i)=>{s&&$(r)?t[i]=mt(r,s):t[i]=r},{allOwnKeys:n}),t),Ws=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hs=(t,e,s,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},Js=(t,e,s,n)=>{let r,i,o;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)o=r[i],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=s!==!1&&qe(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ks=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const n=t.indexOf(e,s);return n!==-1&&n===s},Gs=t=>{if(!t)return null;if(re(t))return t;let e=t.length;if(!_t(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Ys=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qe(Uint8Array)),Zs=(t,e)=>{const s=(t&&t[we]).call(t);let n;for(;(n=s.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},Xs=(t,e)=>{let s;const n=[];for(;(s=t.exec(e))!==null;)n.push(s);return n},Qs=z("HTMLFormElement"),en=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),vt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),tn=z("RegExp"),St=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),n={};le(s,(r,i)=>{let o;(o=e(r,i,t))!==!1&&(n[i]=o||r)}),Object.defineProperties(t,n)},sn=t=>{St(t,(e,s)=>{if($(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const n=t[s];if($(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},nn=(t,e)=>{const s={},n=r=>{r.forEach(i=>{s[i]=!0})};return re(t)?n(t):n(String(t).split(e)),s},rn=()=>{},on=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function an(t){return!!(t&&$(t.append)&&t[gt]==="FormData"&&t[we])}const cn=t=>{const e=new Array(10),s=(n,r)=>{if(Ee(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const i=re(n)?[]:{};return le(n,(o,a)=>{const l=s(o,r+1);!ce(l)&&(i[a]=l)}),e[r]=void 0,i}}return n};return s(t,0)},ln=z("AsyncFunction"),un=t=>t&&(Ee(t)||$(t))&&$(t.then)&&$(t.catch),Et=((t,e)=>t?setImmediate:e?((s,n)=>(Z.addEventListener("message",({source:r,data:i})=>{r===Z&&i===s&&n.length&&n.shift()()},!1),r=>{n.push(r),Z.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",$(Z.postMessage)),dn=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||Et,hn=t=>t!=null&&$(t[we]),c={isArray:re,isArrayBuffer:bt,isBuffer:Rs,isFormData:Us,isArrayBufferView:As,isString:Is,isNumber:_t,isBoolean:Ts,isObject:Ee,isPlainObject:xe,isReadableStream:$s,isRequest:Bs,isResponse:qs,isHeaders:Vs,isUndefined:ce,isDate:Ls,isFile:Ns,isBlob:Ps,isRegExp:tn,isFunction:$,isStream:Ds,isURLSearchParams:Fs,isTypedArray:Ys,isFileList:js,forEach:le,merge:Ve,extend:zs,trim:Ms,stripBOM:Ws,inherits:Hs,toFlatObject:Js,kindOf:ve,kindOfTest:z,endsWith:Ks,toArray:Gs,forEachEntry:Zs,matchAll:Xs,isHTMLForm:Qs,hasOwnProperty:vt,hasOwnProp:vt,reduceDescriptors:St,freezeMethods:sn,toObjectSet:nn,toCamelCase:en,noop:rn,toFiniteNumber:on,findKey:yt,global:Z,isContextDefined:wt,isSpecCompliantForm:an,toJSONObject:cn,isAsyncFn:ln,isThenable:un,setImmediate:Et,asap:dn,isIterable:hn};function v(t,e,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}c.inherits(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=v.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ct[t]={value:t}}),Object.defineProperties(v,Ct),Object.defineProperty(xt,"isAxiosError",{value:!0}),v.from=(t,e,s,n,r,i)=>{const o=Object.create(xt);return c.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(o,t.message,e,s,n,r),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const fn=null;function Me(t){return c.isPlainObject(t)||c.isArray(t)}function Ot(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function kt(t,e,s){return t?t.concat(e).map(function(n,r){return n=Ot(n),!s&&r?"["+n+"]":n}).join(s?".":""):e}function pn(t){return c.isArray(t)&&!t.some(Me)}const mn=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Ce(t,e,s){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=c.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,w){return!c.isUndefined(w[f])});const n=s.metaTokens,r=s.visitor||u,i=s.dots,o=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(!a&&c.isBlob(f))throw new v("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,w,p){let A=f;if(f&&!p&&typeof f=="object"){if(c.endsWith(w,"{}"))w=n?w:w.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&pn(f)||(c.isFileList(f)||c.endsWith(w,"[]"))&&(A=c.toArray(f)))return w=Ot(w),A.forEach(function(R,E){!(c.isUndefined(R)||R===null)&&e.append(o===!0?kt([w],E,i):o===null?w:w+"[]",l(R))}),!1}return Me(f)?!0:(e.append(kt(p,w,i),l(f)),!1)}const d=[],h=Object.assign(mn,{defaultVisitor:u,convertValue:l,isVisitable:Me});function b(f,w){if(!c.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(f),c.forEach(f,function(p,A){(!(c.isUndefined(p)||p===null)&&r.call(e,p,c.isString(A)?A.trim():A,w,h))===!0&&b(p,w?w.concat(A):[A])}),d.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return b(t),e}function Rt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function ze(t,e){this._pairs=[],t&&Ce(t,this,e)}const At=ze.prototype;At.append=function(t,e){this._pairs.push([t,e])},At.toString=function(t){const e=t?function(s){return t.call(this,s,Rt)}:Rt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function gn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function It(t,e,s){if(!e)return t;const n=s&&s.encode||gn;c.isFunction(s)&&(s={serialize:s});const r=s&&s.serialize;let i;if(r?i=r(e,s):i=c.isURLSearchParams(e)?e.toString():new ze(e,s).toString(n),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Tt{constructor(){this.handlers=[]}use(e,s,n){return this.handlers.push({fulfilled:e,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Lt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bn=typeof URLSearchParams<"u"?URLSearchParams:ze,_n=typeof FormData<"u"?FormData:null,yn=typeof Blob<"u"?Blob:null,wn={isBrowser:!0,classes:{URLSearchParams:bn,FormData:_n,Blob:yn},protocols:["http","https","file","blob","url","data"]},We=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,vn=We&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),Sn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",En=We&&window.location.href||"http://localhost",xn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:We,hasStandardBrowserEnv:vn,hasStandardBrowserWebWorkerEnv:Sn,navigator:He,origin:En},Symbol.toStringTag,{value:"Module"})),U={...xn,...wn};function Cn(t,e){return Ce(t,new U.classes.URLSearchParams,Object.assign({visitor:function(s,n,r,i){return U.isNode&&c.isBuffer(s)?(this.append(n,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function On(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function kn(t){const e={},s=Object.keys(t);let n;const r=s.length;let i;for(n=0;n<r;n++)i=s[n],e[i]=t[i];return e}function Nt(t){function e(s,n,r,i){let o=s[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=s.length;return o=!o&&c.isArray(r)?r.length:o,l?(c.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):((!r[o]||!c.isObject(r[o]))&&(r[o]=[]),e(s,n,r[o],i)&&c.isArray(r[o])&&(r[o]=kn(r[o])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const s={};return c.forEachEntry(t,(n,r)=>{e(On(n),r,s,0)}),s}return null}function Rn(t,e,s){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(t)}const ue={transitional:Lt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=c.isObject(t);if(r&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return n?JSON.stringify(Nt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Cn(t,this.formSerializer).toString();if((i=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Ce(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Rn(t)):t}],transformResponse:[function(t){const e=this.transitional||ue.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(s&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(i){if(r)throw i.name==="SyntaxError"?v.from(i,v.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{ue.headers[t]={}});const An=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),In=t=>{const e={};let s,n,r;return t&&t.split(`
|
3
|
+
`).forEach(function(i){r=i.indexOf(":"),s=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+1).trim(),!(!s||e[s]&&An[s])&&(s==="set-cookie"?e[s]?e[s].push(n):e[s]=[n]:e[s]=e[s]?e[s]+", "+n:n)}),e},Pt=Symbol("internals");function de(t){return t&&String(t).trim().toLowerCase()}function Oe(t){return t===!1||t==null?t:c.isArray(t)?t.map(Oe):String(t)}function Tn(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=s.exec(t);)e[n[1]]=n[2];return e}const Ln=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Je(t,e,s,n,r){if(c.isFunction(n))return n.call(this,e,s);if(r&&(e=s),!!c.isString(e)){if(c.isString(n))return e.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(e)}}function Nn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,n)=>s.toUpperCase()+n)}function Pn(t,e){const s=c.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+s,{value:function(r,i,o){return this[n].call(this,e,r,i,o)},configurable:!0})})}let B=class{constructor(t){t&&this.set(t)}set(t,e,s){const n=this;function r(o,a,l){const u=de(a);if(!u)throw new Error("header name must be a non-empty string");const d=c.findKey(n,u);(!d||n[d]===void 0||l===!0||l===void 0&&n[d]!==!1)&&(n[d||a]=Oe(o))}const i=(o,a)=>c.forEach(o,(l,u)=>r(l,u,a));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(c.isString(t)&&(t=t.trim())&&!Ln(t))i(In(t),e);else if(c.isObject(t)&&c.isIterable(t)){let o={},a,l;for(const u of t){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(a=o[l])?c.isArray(a)?[...a,u[1]]:[a,u[1]]:u[1]}i(o,e)}else t!=null&&r(e,t,s);return this}get(t,e){if(t=de(t),t){const s=c.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Tn(n);if(c.isFunction(e))return e.call(this,n,s);if(c.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=de(t),t){const s=c.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Je(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(i){if(i=de(i),i){const o=c.findKey(s,i);o&&(!e||Je(s,s[o],o,e))&&(delete s[o],n=!0)}}return c.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let s=e.length,n=!1;for(;s--;){const r=e[s];(!t||Je(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,s={};return c.forEach(this,(n,r)=>{const i=c.findKey(s,r);if(i){e[i]=Oe(n),delete e[r];return}const o=t?Nn(r):String(r).trim();o!==r&&delete e[r],e[o]=Oe(n),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return c.forEach(this,(s,n)=>{s!=null&&s!==!1&&(e[n]=t&&c.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
4
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const e=(this[Pt]=this[Pt]={accessors:{}}).accessors,s=this.prototype;function n(r){const i=de(r);e[i]||(Pn(s,r),e[i]=!0)}return c.isArray(t)?t.forEach(n):n(t),this}};B.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(B.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[s]=n}}}),c.freezeMethods(B);function Ke(t,e){const s=this||ue,n=e||s,r=B.from(n.headers);let i=n.data;return c.forEach(t,function(o){i=o.call(s,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function jt(t){return!!(t&&t.__CANCEL__)}function ie(t,e,s){v.call(this,t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(ie,v,{__CANCEL__:!0});function Dt(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function jn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Dn(t,e){t=t||10;const s=new Array(t),n=new Array(t);let r=0,i=0,o;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),u=n[i];o||(o=l),s[r]=a,n[r]=l;let d=i,h=0;for(;d!==r;)h+=s[d++],d=d%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),l-o<e)return;const b=u&&l-u;return b?Math.round(h*1e3/b):void 0}}function Un(t,e){let s=0,n=1e3/e,r,i;const o=(a,l=Date.now())=>{s=l,r=null,i&&(clearTimeout(i),i=null),t.apply(null,a)};return[(...a)=>{const l=Date.now(),u=l-s;u>=n?o(a,l):(r=a,i||(i=setTimeout(()=>{i=null,o(r)},n-u)))},()=>r&&o(r)]}const ke=(t,e,s=3)=>{let n=0;const r=Dn(50,250);return Un(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-n,u=r(l),d=o<=a;n=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},s)},Ut=(t,e)=>{const s=t!=null;return[n=>e[0]({lengthComputable:s,total:t,loaded:n}),e[1]]},Ft=t=>(...e)=>c.asap(()=>t(...e)),Fn=U.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,U.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,$n=U.hasStandardBrowserEnv?{write(t,e,s,n,r,i){const o=[t+"="+encodeURIComponent(e)];c.isNumber(s)&&o.push("expires="+new Date(s).toGMTString()),c.isString(n)&&o.push("path="+n),c.isString(r)&&o.push("domain="+r),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Bn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $t(t,e,s){let n=!Bn(e);return t&&(n||s==!1)?qn(t,e):e}const Bt=t=>t instanceof B?{...t}:t;function X(t,e){e=e||{};const s={};function n(u,d,h,b){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:b},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function r(u,d,h,b){if(c.isUndefined(d)){if(!c.isUndefined(u))return n(void 0,u,h,b)}else return n(u,d,h,b)}function i(u,d){if(!c.isUndefined(d))return n(void 0,d)}function o(u,d){if(c.isUndefined(d)){if(!c.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function a(u,d,h){if(h in e)return n(u,d);if(h in t)return n(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d,h)=>r(Bt(u),Bt(d),h,!0)};return c.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=l[u]||r,h=d(t[u],e[u],u);c.isUndefined(h)&&d!==a||(s[u]=h)}),s}const qt=t=>{const e=X({},t);let{data:s,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=B.from(o),e.url=It($t(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(c.isFormData(s)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(U.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(e)),n||n!==!1&&Fn(e.url))){const u=r&&i&&$n.read(i);u&&o.set(r,u)}return e},Vn=typeof XMLHttpRequest<"u",Mn=Vn&&function(t){return new Promise(function(e,s){const n=qt(t);let r=n.data;const i=B.from(n.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=n,u,d,h,b,f;function w(){b&&b(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout;function A(){if(!p)return;const E=B.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:E,config:t,request:p};Dt(function(V){e(V),w()},function(V){s(V),w()},O),p=null}"onloadend"in p?p.onloadend=A:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(A)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(){s(new v("Network Error",v.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let E=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const O=n.transitional||Lt;n.timeoutErrorMessage&&(E=n.timeoutErrorMessage),s(new v(E,O.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},r===void 0&&i.setContentType(null),"setRequestHeader"in p&&c.forEach(i.toJSON(),function(E,O){p.setRequestHeader(O,E)}),c.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),o&&o!=="json"&&(p.responseType=n.responseType),l&&([h,f]=ke(l,!0),p.addEventListener("progress",h)),a&&p.upload&&([d,b]=ke(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(n.cancelToken||n.signal)&&(u=E=>{p&&(s(!E||E.type?new ie(null,t,p):E),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const R=jn(n.url);if(R&&U.protocols.indexOf(R)===-1){s(new v("Unsupported protocol "+R+":",v.ERR_BAD_REQUEST,t));return}p.send(r||null)})},zn=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let n=new AbortController,r;const i=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;n.abort(d instanceof v?d:new ie(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=n;return l.unsubscribe=()=>c.asap(a),l}},Wn=function*(t,e){let s=t.byteLength;if(s<e){yield t;return}let n=0,r;for(;n<s;)r=n+e,yield t.slice(n,r),n=r},Hn=async function*(t,e){for await(const s of Jn(t))yield*Wn(s,e)},Jn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:s,value:n}=await e.read();if(s)break;yield n}}finally{await e.cancel()}},Vt=(t,e,s,n)=>{const r=Hn(t,e);let i=0,o,a=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await r.next();if(u){a(),l.close();return}let h=d.byteLength;if(s){let b=i+=h;s(b)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},Re=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Mt=Re&&typeof ReadableStream=="function",Kn=Re&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),zt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Gn=Mt&&zt(()=>{let t=!1;const e=new Request(U.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Wt=64*1024,Ge=Mt&&zt(()=>c.isReadableStream(new Response("").body)),Ae={stream:Ge&&(t=>t.body)};Re&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ae[e]&&(Ae[e]=c.isFunction(t[e])?s=>s[e]():(s,n)=>{throw new v(`Response type '${e}' is not supported`,v.ERR_NOT_SUPPORT,n)})})})(new Response);const Yn=async t=>{if(t==null)return 0;if(c.isBlob(t))return t.size;if(c.isSpecCompliantForm(t))return(await new Request(U.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(c.isArrayBufferView(t)||c.isArrayBuffer(t))return t.byteLength;if(c.isURLSearchParams(t)&&(t=t+""),c.isString(t))return(await Kn(t)).byteLength},Zn=async(t,e)=>c.toFiniteNumber(t.getContentLength())??Yn(e),Xn=Re&&(async t=>{let{url:e,method:s,data:n,signal:r,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:b}=qt(t);u=u?(u+"").toLowerCase():"text";let f=zn([r,i&&i.toAbortSignal()],o),w;const p=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let A;try{if(l&&Gn&&s!=="get"&&s!=="head"&&(A=await Zn(d,n))!==0){let _=new Request(e,{method:"POST",body:n,duplex:"half"}),j;if(c.isFormData(n)&&(j=_.headers.get("content-type"))&&d.setContentType(j),_.body){const[T,x]=Ut(A,ke(Ft(l)));n=Vt(_.body,Wt,T,x)}}c.isString(h)||(h=h?"include":"omit");const R="credentials"in Request.prototype;w=new Request(e,{...b,signal:f,method:s.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:R?h:void 0});let E=await fetch(w);const O=Ge&&(u==="stream"||u==="response");if(Ge&&(a||O&&p)){const _={};["status","statusText","headers"].forEach(L=>{_[L]=E[L]});const j=c.toFiniteNumber(E.headers.get("content-length")),[T,x]=a&&Ut(j,ke(Ft(a),!0))||[];E=new Response(Vt(E.body,Wt,T,()=>{x&&x(),p&&p()}),_)}u=u||"text";let V=await Ae[c.findKey(Ae,u)||"text"](E,t);return!O&&p&&p(),await new Promise((_,j)=>{Dt(_,j,{data:V,headers:B.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:w})})}catch(R){throw p&&p(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,t,w),{cause:R.cause||R}):v.from(R,R&&R.code,t,w)}}),Ye={http:fn,xhr:Mn,fetch:Xn};c.forEach(Ye,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ht=t=>`- ${t}`,Qn=t=>c.isFunction(t)||t===null||t===!1,Jt={getAdapter:t=>{t=c.isArray(t)?t:[t];const{length:e}=t;let s,n;const r={};for(let i=0;i<e;i++){s=t[i];let o;if(n=s,!Qn(s)&&(n=Ye[(o=String(s)).toLowerCase()],n===void 0))throw new v(`Unknown adapter '${o}'`);if(n)break;r[o||"#"+i]=n}if(!n){const i=Object.entries(r).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
|
5
5
|
`+i.map(Ht).join(`
|
6
|
-
`):" "+Ht(i[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Ye};function
|
7
|
-
`+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=X(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&Te.assertOptions(s,{silentJSONParsing:K.transitional(K.boolean),forcedJSONParsing:K.transitional(K.boolean),clarifyTimeoutError:K.transitional(K.boolean)},!1),n!=null&&(c.isFunction(n)?e.paramsSerializer={serialize:n}:Te.assertOptions(n,{encode:K.function,serialize:K.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Te.assertOptions(e,{baseUrl:K.spelling("baseURL"),withXsrfToken:K.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=r&&c.merge(r.common,r[e.method]);r&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),e.headers=$.concat(i,r);const o=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(a=a&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,d=0,h;if(!a){const f=[Kt.bind(this),void 0];for(f.unshift.apply(f,o),f.push.apply(f,l),h=f.length,u=Promise.resolve(e);d<h;)u=u.then(f[d++],f[d++]);return u}h=o.length;let b=e;for(d=0;d<h;){const f=o[d++],w=o[d++];try{b=f(b)}catch(p){w.call(this,p);break}}try{u=Kt.call(this,b)}catch(f){return Promise.reject(f)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=X(this.defaults,t);const e=Bt(t.baseURL,t.url,t.allowAbsoluteUrls);return At(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Q.prototype[t]=function(e,s){return this.request(X(s||{},{method:t,url:e,data:(s||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function e(s){return function(n,r,i){return this.request(X(i||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Q.prototype[t]=e(),Q.prototype[t+"Form"]=e(!0)});let tr=class ys{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(r){s=r});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},e(function(r,i,o){n.reason||(n.reason=new ie(r,i,o),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const e=new AbortController,s=n=>{e.abort(n)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new ys(function(s){e=s}),cancel:e}}};function sr(t){return function(e){return t.apply(null,e)}}function nr(t){return c.isObject(t)&&t.isAxiosError===!0}const Xe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xe).forEach(([t,e])=>{Xe[e]=t});function Gt(t){const e=new Q(t),s=mt(Q.prototype.request,e);return c.extend(s,Q.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(n){return Gt(X(t,n))},s}const A=Gt(ue);A.Axios=Q,A.CanceledError=ie,A.CancelToken=tr,A.isCancel=jt,A.VERSION=Zt,A.toFormData=Ce,A.AxiosError=v,A.Cancel=A.CanceledError,A.all=function(t){return Promise.all(t)},A.spread=sr,A.isAxiosError=nr,A.mergeConfig=X,A.AxiosHeaders=$,A.formToJSON=t=>Nt(c.isHTMLForm(t)?new FormData(t):t),A.getAdapter=Jt.getAdapter,A.HttpStatusCode=Xe,A.default=A;const{Axios:Ai,AxiosError:Ti,CanceledError:Li,isCancel:Ni,CancelToken:Pi,VERSION:ji,all:Ui,Cancel:Di,isAxiosError:Fi,spread:Bi,toFormData:$i,AxiosHeaders:qi,HttpStatusCode:Vi,formToJSON:Mi,getAdapter:zi,mergeConfig:Wi}=A,Xt=A.create({baseURL:location.origin,timeout:6e4,params:{}});Xt.interceptors.response.use(t=>t,t=>{var e,s,n,r,i,o,a,l,u,d,h;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(w){w&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(n=(s=t.response)==null?void 0:s.config)!=null&&n.data&&(b+=`${t.response.config.data} `),(i=(r=t.response)==null?void 0:r.data)!=null&&i.message?b+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.error)!=null&&d.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(h=t.response)==null?void 0:h.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:b}),t}else throw t});let Le=()=>({emit(t,...e){for(let s=this.events[t]||[],n=0,r=s.length;n<r;n++)s[n](...e)},events:{},on(t,e){var s;return((s=this.events)[t]||(s[t]=[])).push(e),()=>{var n;this.events[t]=(n=this.events[t])==null?void 0:n.filter(r=>e!==r)}}});class he extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class Qe extends he{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class rr extends he{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class W extends he{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class ir extends W{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Qt(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let s=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${s}`}).join(",")}}`:""}class or{constructor(e){this.channel=e,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",e=>{if(e.type==="info"){this._state||(this._state=this.stateFromInfo(e));return}this._state&&(e.type==="join"?this._state[e.id]=e.info:e.type==="leave"&&delete this._state[e.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(e=>e()),this.listeners.length=0}async join(e,s){if(!this._info)return this._info={id:e,info:s},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let e=await this.channel.perform("$presence:leave");return delete this._info,e}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let e=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(e),this._state}finally{delete this._promise}}stateFromInfo(e){return e.records.reduce((s,{id:n,info:r})=>(s[n]=r,s),{})}}const ee=Symbol("state");class es{constructor(e={}){this.emitter=Le(),this.params=Object.freeze(e),this.presence=new or(this),this.initialConnect=!0,this[ee]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Qt({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[ee]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[ee]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[ee]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[ee]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[ee]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[ee]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let n=this.receiver?this.receiver.logger:null;n&&n.warn("whisper failed: ",s)}}receive(e,s){this.emit("message",e,s)}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}emit(e,...s){return this.emitter.emit(e,...s)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((e,s)=>{let n=[()=>delete this._pendingSubscribe];n.push(this.on("connect",()=>{n.forEach(r=>r()),e()})),n.push(this.on("close",r=>{n.forEach(i=>i()),s(r||new he("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class ar{constructor(e){this.id=e,this.intent="unsubscribed",this.state="idle",this.channels=[],this.disposed=!1,this._pendings=[]}add(e){this.channels.includes(e)||this.channels.push(e)}remove(e){let s=this.channels.indexOf(e);s>-1&&this.channels.splice(s,1)}notify(e,...s){this.state=e==="restored"?"connected":e,s.length===1?this.channels.forEach(n=>n[e](s[0])):this.channels.forEach(n=>n[e]())}pending(e){this._checkIntent(e);let s=this._pendings[0];return!s||s.intent!==e?Promise.resolve():s.promise}ensureResubscribed(){this.disposed||(this.intent=void 0,this.ensureSubscribed())}ensureSubscribed(){if(this.intent!=="subscribed"){if(this.disposed)throw Error("Subscription is disposed");this.intent="subscribed",!this._mergeWithPending("unsubscribed")&&this.subscriber(this)}}maybeUnsubscribe(){this.disposed||this.intent==="unsubscribed"||this.channels.length>0||(this.intent="unsubscribed",this._mergeWithPending("subscribed"))||this.unsubscriber(this)}async acquire(e){this._checkIntent(e);let s,n={promise:new Promise(i=>{s=i}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(n),1),s(n)},canceled:!1,acquired:!1},r=this._pendingTop;return this._pendings.push(n),r&&await r.promise,this.gvl&&await this.gvl.acquire(n,e),n.acquired=!0,n}close(e){this.disposed=!0,this.intent=void 0,this.notify("closed",e)}_checkIntent(e){if(!(e==="unsubscribed"||e==="subscribed"))throw Error(`Unknown subscription intent: ${e}`)}get _pendingTop(){return this._pendings.length?this._pendings[this._pendings.length-1]:void 0}_mergeWithPending(e){let s=this._pendingTop;return!s||s.acquired||s.intent!==e?!1:(this._pendings.pop(),s.canceled=!0,!0)}}class cr{constructor(){this.queue=[]}async acquire(e,s){s==="subscribed"&&(this.queue.push(e.promise.then(()=>{this.queue.splice(this.queue.indexOf(e),1)})),this.queue.length>1&&await this.queue[this.queue.length-2])}}class lr{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new cr),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:s,unsubscribe:n}){let r=this._subscriptions[e]=new ar(e);return r.remoteId=this._localToRemote[e],r.subscriber=s,r.unsubscriber=n,r.gvl=this.glv,r}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,s){this._localToRemote[e]=s;let n=this.get(e);n&&(n.remoteId=s)}}class ur{constructor(e={}){this.subscriptions=new lr(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,s){this._remoteToLocal[s]=e,this.subscriptions.storeRemoteId(e,s),this.flush(s)}unsubscribe(e){let s=this.subscriptions.get(e);if(!s)return;let n=s.remoteId;n&&delete this._remoteToLocal[n],this.subscriptions.remove(e)}transmit(e,s,n){let r=this._remoteToLocal[e];if(!r){this._pendingMessages.push([e,s,n]);return}let i=this.subscriptions.get(r);i&&i.channels.forEach(o=>{o.receive(s,n)})}notify(e,s,n){let r=this._remoteToLocal[e];if(!r)return;let i=this.subscriptions.get(r);i&&i.channels.forEach(o=>o.emit(s,n))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let s=[];for(let n of this._pendingMessages)n[0]===e?this.transmit(n[0],n[1],n[2]):s.push(n);this._pendingMessages=s}}const ts={debug:0,info:1,warn:2,error:3};class ss{constructor(e){this.level=e||"warn"}log(e,s,n){ts[e]<ts[this.level]||this.writeLogEntry(e,s,n)}writeLogEntry(){throw Error("Not implemented")}debug(e,s){this.log("debug",e,s)}info(e,s){this.log("info",e,s)}warn(e,s){this.log("warn",e,s)}error(e,s){this.log("error",e,s)}}class fe extends ss{writeLogEntry(){}}class dr{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let hr=0;class ns{constructor(e={}){let{logger:s}=e;this.logger=s||new fe,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,s){let n={channel:e};s&&Object.assign(n,s);let r=Qt(n);if(this.pendingUnsubscriptions[r]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,r),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},o)})}if(this.pendingSubscriptions[r])return this.logger.warn("subscription is already pending, skipping",r),Promise.reject(Error("Already subscribing"));let i=this.subscribeRetryInterval;return new Promise((o,a)=>{let l=++hr;this.pendingSubscriptions[r]={resolve:o,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(r)),this.maybeRetrySubscribe(l,r,i)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,s,n){setTimeout(()=>{let r=this.pendingSubscriptions[s];r&&r.id===e&&(this.logger.warn(`no subscription ack received in ${n}ms, retrying subscribe`,s),this.cable.send(this.buildSubscribeRequest(s)),this.maybeExpireSubscribe(e,s,n))},n)}maybeExpireSubscribe(e,s,n){setTimeout(()=>{let r=this.pendingSubscriptions[s];r&&r.id===e&&(delete this.pendingSubscriptions[s],r.reject(new rr(`Haven't received subscription ack in ${n*2}ms for ${s}`)))},n)}unsubscribe(e){return this.cable.send({command:"unsubscribe",identifier:e}),this.pendingUnsubscriptions[e]=!0,setTimeout(()=>{delete this.pendingUnsubscriptions[e]},this.subscribeCooldownInterval),Promise.resolve()}perform(e,s,n){return s==="$whisper"?this.whisper(e,n):(n||(n={}),n.action=s,this.cable.send({command:"message",identifier:e,data:JSON.stringify(n)}),Promise.resolve())}whisper(e,s){return this.cable.send({command:"whisper",identifier:e,data:s}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:n,message:r,reason:i,reconnect:o}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new W(i);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[n];if(!a){this.logger.error("subscription not found, unsubscribing",{type:s,identifier:n}),this.unsubscribe(n);return}return delete this.pendingSubscriptions[n],a.resolve(n)}if(s==="reject_subscription"){let a=this.pendingSubscriptions[n];return a?(delete this.pendingSubscriptions[n],a.reject(new Qe)):this.logger.error("subscription not found",{type:s,identifier:n})}if(r)return{identifier:n,message:r};this.logger.warn(`unknown message type: ${s}`,{message:e})}reset(e){for(let s in this.pendingSubscriptions)this.pendingSubscriptions[s].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const rs=()=>Date.now()/1e3|0;class fr extends ns{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=rs()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let s in this.pendingPresence)this.pendingPresence[s].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:n,message:r}=e;if(s==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(s==="reject_subscription")return super.receive(e);if(s==="confirm_subscription")return this.subscriptionStreams[n]||(this.subscriptionStreams[n]=new Set),super.receive(e);if(s==="ping")return this.restoreSince&&(this.restoreSince=rs()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",n);return}if(s==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",n);return}if(s==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let i=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of i)this.cable.send({identifier:o,command:"history",history:this.historyRequestFor(o)}),this.presenceInfo[o]&&this.cable.send({identifier:o,command:"join",presence:this.presenceInfo[o]});return this.cable.restored(i)}return this.cable.connected(this.sessionId)}if(s==="presence"){let i=r.type;if(i==="info"){let o=this.pendingPresence[n];o&&(delete this.pendingPresence[n],o.resolve(r))}else if(i==="error"){let o=this.pendingPresence[n];o&&(delete this.pendingPresence[n],o.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:n,message:r}}if(r){let i=this.trackStreamPosition(n,e.stream_id,e.epoch,e.offset);return{identifier:n,message:r,meta:i}}this.logger.warn(`unknown message type: ${s}`,{message:e})}perform(e,s,n){switch(s){case"$presence:join":return this.join(e,n);case"$presence:leave":return this.leave(e,n);case"$presence:info":return this.presence(e,n)}return super.perform(e,s,n)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let s=super.buildSubscribeRequest(e),n=this.historyRequestFor(e);n&&(s.history=n,this.pendingHistory[e]=!0);let r=this.presenceInfo[e];return r&&(s.presence=r),s}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let s={},n=!1;if(this.subscriptionStreams[e])for(let r of this.subscriptionStreams[e]){let i=this.streamsPositions[r];i&&(n=!0,s[r]=i)}if(!(!n&&!this.restoreSince))return{since:this.restoreSince,streams:s}}trackStreamPosition(e,s,n,r){if(!(!s||!n))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(s),this.streamsPositions[s]={epoch:n,offset:r},{stream:s,epoch:n,offset:r}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,s){return this.presenceInfo[e]=s,this.cable.send({command:"join",identifier:e,presence:s}),Promise.resolve()}async leave(e,s){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:s}),Promise.resolve()}presence(e,s){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((n,r)=>{this.pendingPresence[e]={resolve:n,reject:r},this.cable.send({command:"presence",identifier:e,data:s})})}}class pr extends he{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class et extends es{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ye(et,"identifier","__ghost__");const mr="$pubsub";class tt extends es{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}ye(tt,"identifier",mr);const te=Symbol("state");let gr=class{constructor({transport:t,protocol:e,encoder:s,logger:n,lazy:r,hubOptions:i,performFailures:o,transportConfigurator:a}){this.emitter=Le(),this.transport=t,this.encoder=s,this.logger=n||new fe,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new ur(i||{}),this[te]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,r===!1&&this.connect().catch(()=>{})}get state(){return this[te]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[te]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[te]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new W("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[te]="connected",this.hub.subscriptions.all().forEach(n=>{t&&n.remoteId&&t.includes(n.remoteId)?n.notify("restored"):(n.notify("disconnected",new W("recovery_failed")),this._resubscribe(n))});let e=!this.initialConnect,s=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:s})}notify(t,e,s){e&&typeof e!="string"&&(s=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:s}):this.emit("info",{type:t,data:s})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new W(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[te]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof W?t:new W(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[te]="closed";let s=e||new W("cable_closed");this.hub.subscriptions.all().forEach(n=>n.notify("disconnected",s)),this.hub.close(),this.protocol.reset(),this.transport.close(),this.initialConnect=!0,this.emit("close",e)}disconnect(){this.closed()}handleIncoming(t){if(this.state==="closed"||this.state==="idle")return;let e=this.encoder.decode(t);if(e===void 0){this.logger.error("failed to decode message",{message:t});return}this.logger.debug("incoming data",e);let s=this.protocol.receive(e);if(s){this.logger.debug("processed incoming message",s);let{type:n,identifier:r,message:i,meta:o}=s;n?this.hub.notify(r,n,i):this.hub.transmit(r,i,o)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new tt({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new tt({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,n;return typeof t=="string"&&(n=t,t=et),s=n?new t(n,e):new t(e),this.subscribe(s)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let s=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:n=>this._subscribe(n,t.channelId,t.params),unsubscribe:n=>this._unsubscribe(n)});return s.add(t),s.intent==="subscribed"&&s.state==="connected"&&t.connected(),s.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,s){let n=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:n});return}this.logger.debug("acquiring subscribe lock",{identifier:n});let r=await t.acquire("subscribed");if(r.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:n}),r.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:n}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),r.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:n}),r.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:n}),t.notify("connected"),r.release();return}let i={identifier:e,params:s};this.logger.debug("subscribing",i);try{let o=await this.protocol.subscribe(e,s);this.hub.subscribe(n,o),this.logger.debug("subscribed",{...i,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof Qe&&this.logger.warn("rejected",i),o instanceof W){this.logger.debug("disconnected during subscription; will retry on connect",i),r.release();return}this.logger.error("failed to subscribe",{error:o,...i})}t.close(o),this.hub.unsubscribe(n)}r.release()}unsubscribe(t){let e=t.identifier,s=this.hub.subscriptions.get(e);if(!s)throw Error(`Subscription not found: ${e}`);s.remove(t),t.closed(),s.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let s=await t.acquire("unsubscribed");if(s.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),s.release();return}if(this.logger.debug("unsubscribe lock has been acquired",{identifier:e}),t.intent!=="unsubscribed"){this.logger.debug("cancel unsubscribe, no longer needed",{identifier:e,intent:t.intent}),s.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),s.release();return}let n=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:n}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),s.release();return}try{await this.protocol.unsubscribe(n),this.logger.debug("unsubscribed remotely",{id:e})}catch(r){r&&(r instanceof W?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:r}):this.logger.error("unsubscribe failed",{id:e,error:r}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",s.release()}async perform(t,e,s){if(this.performFailures==="throw")return this._perform(t,e,s);try{return await this._perform(t,e,s)}catch(n){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:n});return}}async _perform(t,e,s){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new pr;let n=this.hub.subscriptions.get(t);if(!n)throw Error(`Subscription not found: ${t}`);if(await n.pending("subscribed"),n.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let r=n.remoteId,i={id:r,action:e,payload:s};this.logger.debug("perform",i);try{let o=await this.protocol.perform(r,e,s);return o&&this.logger.debug("perform result",{message:o,request:i}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:i}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...n)=>{s(),e(...n)});return s}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let s=[()=>delete this._pendingConnect];s.push(this.on("connect",()=>{s.forEach(n=>n()),t()})),s.push(this.on("close",n=>{s.forEach(r=>r()),e(n)})),s.push(this.on("disconnect",n=>{s.forEach(r=>r()),e(n)}))}),this._pendingConnect)}};const br={maxMissingPings:2,maxReconnectAttempts:1/0},oe=()=>Date.now(),is=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:n,maxInterval:r}=e;return s=s||2,n===void 0&&(n=.5),i=>{let o=t*s**i,a=o*s,l=o+(a-o)*Math.random(),u=2*(Math.random()-.5)*n;return l=l*(1+u),r&&r<l&&(l=r),l}};let os=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},br,e),this.strategy=e.reconnectStrategy,!this.strategy)throw Error("Reconnect strategy must be provided");this.maxMissingPings=e.maxMissingPings,this.maxReconnectAttempts=e.maxReconnectAttempts,this.logger=e.logger||new fe,this.state="pending_connect",this.attempts=0,this.disconnectedAt=oe()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=oe(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=oe(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=oe(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=oe()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=oe()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new ir))}scheduleReconnect(){if(this.attempts>=this.maxReconnectAttempts){this.target.close();return}let t=this.strategy(this.attempts);this.attempts++,this.logger.info(`Reconnecting in ${t}ms (${this.attempts} attempt)`),this.state="pending_reconnect",this.reconnnectId=setTimeout(()=>this.reconnectNow(),t)}cancelReconnect(){this.reconnnectId&&(clearTimeout(this.reconnnectId),delete this.reconnnectId)}};class _r{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Le(),this.unbind=[],this.logger=s.logger||new fe}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let s=this.transports[e];try{this.transport=s,this.resetListeners(),this.logger.debug(`Trying to connect via ${s.displayName()}`),await s.open(),this.logger.debug(`Connected via ${s.displayName()}`);return}catch(n){this.logger.debug(`Failed to connect via ${s.displayName()}: ${n.message}`)}}throw this.transport=null,this.resetListeners(),new Error("Couldn't connect via any available transport")}send(e){if(!this.transport)throw new Error("No transport is open");this.transport.send(e)}async close(){if(!this.transport)throw new Error("No transport is open");await this.transport.close(),this.transport=null}setURL(){throw new Error("Not implemented. Set URL for each transport separately")}setParam(e,s){this.transports.forEach(n=>{n.setParam(e,s)})}setToken(e,s){this.transports.forEach(n=>{n.setToken(e,s)})}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}get url(){return this.transport?this.transport.url:""}resetListeners(){this.unbind.forEach(e=>e()),this.unbind.length=0,this.transport&&this.unbind.push(this.transport.on("open",()=>{this.emitter.emit("open")}),this.transport.on("data",e=>{this.emitter.emit("data",e)}),this.transport.on("close",e=>{this.emitter.emit("close",e)}),this.transport.on("error",e=>{this.emitter.emit("error",e)}))}}class yr{constructor(e,s={}){this.url=e;let n=s.websocketImplementation;if(n)this.Impl=n;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Le();let{format:r,subprotocol:i,authStrategy:o}=s;this.format=r||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=i}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((s,n)=>{let r=[];r.push(this.once("open",()=>{r.forEach(i=>i()),s()})),r.push(this.once("close",()=>{r.forEach(i=>i()),n(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,s){let n=new URL(this.url);n.searchParams.set(e,s);let r=`${n.protocol}//${n.host}${n.pathname}?${n.searchParams}`;this.setURL(r)}setToken(e,s="jid"){if(this.authStrategy==="param")this.setParam(s,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let n=`x-${s}`.toLowerCase();n=Object.keys(this.connectionOptions.headers).find(r=>r.toLowerCase()===n)||n,this.connectionOptions.headers[n]=e}else if(this.authStrategy==="sub-protocol")this.authProtocol=`anycable-token.${e}`;else throw new Error("Unknown auth strategy: "+this.authStrategy)}send(e){if(!this.ws||!this.connected)throw Error("WebSocket is not connected");this.ws.send(e)}close(){this.ws?this.onclose():this.connected=!1}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}initListeners(){this.ws.onerror=e=>{this.connected&&this.emitter.emit("error",e.error||new Error("WS Error"))},this.ws.onclose=()=>{this.onclose()},this.ws.onmessage=e=>{let s=e.data;this.format==="binary"&&(s=new Uint8Array(s)),this.emitter.emit("data",s)},this.ws.onopen=()=>{this.connected=!0,this.emitter.emit("open")}}onclose(){this.ws.onclose=void 0,this.ws.onmessage=void 0,this.ws.onopen=void 0,this.ws.close(),delete this.ws,this.connected=!1,this.emitter.emit("close")}}const as={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function wr(t,e){if(typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),e=e||{},!t&&!e.transport)throw Error("URL or transport must be specified");e=Object.assign({},as,e);let{protocol:s,websocketImplementation:n,websocketFormat:r,websocketOptions:i,websocketAuthStrategy:o,fallbacks:a,logLevel:l,logger:u,transport:d,encoder:h,lazy:b,monitor:f,pingInterval:w,reconnectStrategy:p,maxMissingPings:I,maxReconnectAttempts:R,subprotocol:E,tokenRefresher:O,historyTimestamp:V,protocolOptions:_,concurrentSubscribes:j,performFailures:T,transportConfigurator:x,auth:L}=e;if(u=u||new fe(l),typeof s=="string"){E=E||s;let ae=s.substring(0,s.lastIndexOf("-")),q=s.substring(s.lastIndexOf("-")+1);if(_=_||{},ae==="actioncable-v1")s=new ns({logger:u,..._});else if(ae==="actioncable-v1-ext")s=new fr({logger:u,historyTimestamp:V,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(q==="json")h=h||new dr,r=r||"text";else if(q==="msgpack"){if(r="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(q==="protobuf"){if(r=r||"binary",!h)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${s}`)}if(!s)throw Error("Protocol must be specified");d=d||new yr(t,{websocketImplementation:n,websocketOptions:i,subprotocol:E,authStrategy:o,format:r}),a&&(d=new _r([d,...a],{logger:u})),L&&L.token&&d.setToken(L.token,L.param||"jid"),p=p||is(w),f!==!1&&(f=f||new os({pingInterval:w,reconnectStrategy:p,maxMissingPings:I,maxReconnectAttempts:R,logger:u}));let De={concurrentSubscribes:j},H=new gr({protocol:s,transport:d,encoder:h,logger:u,lazy:b,hubOptions:De,performFailures:T,transportConfigurator:x});return f&&(f.watch(H),H.monitor=f),O&&vr(H,async()=>{try{await O(d)}catch(ae){return u.error("Failed to refresh authentication token: "+ae),!1}return H.connect().catch(()=>{}),!0}),H}function vr(t,e){let s=!1;t.on("connect",()=>s=!1),t.on("close",async n=>{if(n){if(s){t.logger.warn("Token auto-refresh is disabled",n);return}n.reason==="token_expired"&&(s=!0,await e())}})}class Sr{constructor(e){this.channel=e}notify(e,...s){typeof this[e]=="function"&&this[e](...s)}perform(e,s={}){this.channel.perform(e,s)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class Er extends et{constructor(e,s,n){super(e,s),this.subscription=new Sr(this),Object.assign(this.subscription,n),this.on("connect",({reconnect:r})=>this.subscription.notify("connected",{reconnected:r})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",r=>this.subscription.notify("received",r)),this.on("close",r=>{r&&r instanceof Qe?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class xr{constructor(e){this.cable=e}create(e,s){let n,r;typeof e=="object"?(n=e.channel,delete e.channel,r=e):(n=e,r={});let i=new Er(n,r,s);return i.subscription.notify("initialized"),this.cable.subscribe(i),i.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class Cr{constructor(e){this.cable=e,this.subscriptions=new xr(e)}}class Or extends ss{writeLogEntry(e,s,n){n?console[e](s,n):console[e](s)}}class kr extends os{watch(e){super.watch(e),this.initActivityListeners()}initActivityListeners(){if(typeof document<"u"&&typeof window<"u"&&document.addEventListener&&window.addEventListener){let e=()=>{document.hidden||this.reconnectNow()&&this.logger.debug("Trigger reconnect due to visibility change")},s=r=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:r})},n=()=>this.disconnect(new W("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",n,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",s,!1),window.removeEventListener("online",s,!1),window.removeEventListener("resume",s,!1),window.removeEventListener("freeze",n,!1)})}}disconnect(e){this.state==="disconnected"||this.state==="closed"||(this.logger.info("Disconnecting",{reason:e.message}),this.cancelReconnect(),this.stopPolling(),this.state="pending_disconnect",this.target.disconnected(e))}}const Rr=["cable","action-cable"],Ir="/cable",Ne=(t,e)=>{for(let s of Rr){let n=t.head.querySelector(`meta[name='${s}-${e}']`);if(n)return n.getAttribute("content")}},cs=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Ar=()=>{if(typeof document<"u"&&document.head){let t=Ne(document,"url");if(t)return cs(t)}return cs(Ir)},Tr=()=>{if(typeof document<"u"&&document.head){let t=Ne(document,"history-timestamp");if(t)return t|0}},Lr=()=>{if(typeof document<"u"&&document.head)return Ne(document,"token")},Nr=()=>{if(typeof document<"u"&&document.head)return Ne(document,"token-param")};function Pr(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Ar(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Tr());let s=Lr();if(s){let u=Nr();e.auth=Object.assign({token:s,param:u},e.auth||{})}e=Object.assign({},as,e);let{logLevel:n,logger:r,pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l}=e;return r=e.logger=e.logger||new Or(n),o=e.reconnectStrategy=e.reconnectStrategy||is(i),e.monitor!==!1&&(e.monitor=e.monitor||new kr({pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l,logger:r})),wr(t,e)}function jr(t,e){let s=Pr(t,e);return new Cr(s)}class ls{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,n={},r={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(i=>{if(i&&OpenC3Auth.setTokens(),this._cable==null){let o=this._url+"?scope="+encodeURIComponent(window.openc3Scope)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=jr(o)}return this._cable.subscriptions.create({channel:e,...r},n)})}recordPing(){}}function Pe(t){return Ur.test(t)}const Ur=/^-?[0-9]+$/;function us(t){return Dr.test(t)}const Dr=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ds(t,e){const s=Number.parseFloat(t),n=String(s),r=hs(t),i=hs(n);return!!(r===i||(e==null?void 0:e.approx)===!0&&!Pe(t)&&i.length>=14&&r.startsWith(i.substring(0,14)))}let pe=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Fr(t){if(ds(t,{approx:!1}))return;if(Pe(t))return pe.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?pe.underflow:pe.truncate_float:pe.overflow}function hs(t){return t.replace(Br,"").replace(qr,"").replace(Vr,"").replace($r,"")}const Br=/[eE][+-]?\d+$/,$r=/^-?(0*)?/,qr=/\./,Vr=/0+$/;class Mr{constructor(e){if(ye(this,"isLosslessNumber",!0),!us(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Fr(this.value);if(e===void 0||e===pe.truncate_float)return Number.parseFloat(this.value);if(Pe(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function zr(t){return t&&typeof t=="object"&&t.isLosslessNumber===!0||!1}function Wr(t){return new Mr(t)}function Hr(t,e){return st({"":t},"",t,e)}function st(t,e,s,n){return Array.isArray(s)?n.call(t,e,Kr(s,n)):s&&typeof s=="object"&&!zr(s)?n.call(t,e,Jr(s,n)):n.call(t,e,s)}function Jr(t,e){for(const s of Object.keys(t)){const n=st(t,s,t[s],e);n!==void 0?t[s]=n:delete t[s]}return t}function Kr(t,e){for(let s=0;s<t.length;s++)t[s]=st(t,String(s),t[s],e);return t}function Zr(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wr,n=0;const r=a();return w(r),I(),e?Hr(r,e):r;function i(){if(t.charCodeAt(n)===ti){n++,u();const S={};let U=!0;for(;n<t.length&&t.charCodeAt(n)!==ps;){U?U=!1:(b(),u());const se=n,me=d();if(me===void 0){O();return}u(),f();const at=a();if(at===void 0){L();return}Object.prototype.hasOwnProperty.call(S,me)&&!nt(at,S[me])&&V(me,se+1),S[me]=at}return t.charCodeAt(n)!==ps&&_(),n++,S}}function o(){if(t.charCodeAt(n)===si){n++,u();const S=[];let U=!0;for(;n<t.length&&t.charCodeAt(n)!==ms;){U?U=!1:b();const se=a();p(se),S.push(se)}return t.charCodeAt(n)!==ms&&j(),n++,S}}function a(){u();const S=d()??h()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),S}function l(S,U){if(t.slice(n,n+S.length)===S)return n+=S.length,U}function u(){for(;Yr(t.charCodeAt(n));)n++}function d(){if(t.charCodeAt(n)===rt){n++;let S="";for(;n<t.length&&t.charCodeAt(n)!==rt;){if(t.charCodeAt(n)===ei){const U=t[n+1],se=Qr[U];se!==void 0?(S+=se,n++):U==="u"?je(t.charCodeAt(n+2))&&je(t.charCodeAt(n+3))&&je(t.charCodeAt(n+4))&&je(t.charCodeAt(n+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(n+2,n+6),16)),n+=5):De(n):x(n)}else Xr(t.charCodeAt(n))?S+=t[n]:T(t[n]);n++}return E(),n++,S}}function h(){const S=n;if(t.charCodeAt(n)===gs&&(n++,R(S)),t.charCodeAt(n)===it)n++;else if(Gr(t.charCodeAt(n)))for(n++;Ue(t.charCodeAt(n));)n++;if(t.charCodeAt(n)===ui)for(n++,R(S);Ue(t.charCodeAt(n));)n++;if(t.charCodeAt(n)===mi||t.charCodeAt(n)===pi)for(n++,(t.charCodeAt(n)===gs||t.charCodeAt(n)===ai)&&n++,R(S);Ue(t.charCodeAt(n));)n++;if(n>S)return s(t.slice(S,n))}function b(){if(t.charCodeAt(n)!==li)throw new SyntaxError(`Comma ',' expected after value ${q()}`);n++}function f(){if(t.charCodeAt(n)!==di)throw new SyntaxError(`Colon ':' expected after property name ${q()}`);n++}function w(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${q()}`)}function p(S){if(S===void 0)throw new SyntaxError(`Array item expected ${q()}`)}function I(){if(n<t.length)throw new SyntaxError(`Expected end of input ${q()}`)}function R(S){if(!Ue(t.charCodeAt(n))){const U=t.slice(S,n);throw new SyntaxError(`Invalid number '${U}', expecting a digit ${q()}`)}}function E(){if(t.charCodeAt(n)!==rt)throw new SyntaxError(`End of string '"' expected ${q()}`)}function O(){throw new SyntaxError(`Quoted object key expected ${q()}`)}function V(S,U){throw new SyntaxError(`Duplicate key '${S}' encountered at position ${U}`)}function _(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${q()}`)}function j(){throw new SyntaxError(`Array item or end of array ']' expected ${q()}`)}function T(S){throw new SyntaxError(`Invalid character '${S}' ${H()}`)}function x(S){const U=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${U}' ${H()}`)}function L(){throw new SyntaxError(`Object value expected after ':' ${H()}`)}function De(S){const U=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${U}' ${H()}`)}function H(){return`at position ${n}`}function ae(){return n<t.length?`but got '${t[n]}'`:"but reached end of input"}function q(){return`${ae()} ${H()}`}}function Yr(t){return t===ni||t===ri||t===ii||t===oi}function je(t){return t>=it&&t<=ot||t>=hi&&t<=gi||t>=fi&&t<=bi}function Ue(t){return t>=it&&t<=ot}function Gr(t){return t>=ci&&t<=ot}function Xr(t){return t>=32&&t<=1114111}function nt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,n)=>nt(s,e[n])):fs(t)&&fs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>nt(t[s],e[s])):!1}function fs(t){return typeof t=="object"&&t!==null}const Qr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
8
|
-
`,r:"\r",t:" "},ei=92,ti=123,ps=125,si=91,ms=93,ni=32,ri=10,ii=9,oi=13,rt=34,ai=43,gs=45,it=48,ci=49,ot=57,li=44,ui=46,di=58,hi=65,fi=97,pi=69,mi=101,gi=70,bi=102;function bs(t,e,s,n){return r(t);function r(l,u){if(Array.isArray(n)){const d=n.find(h=>h.test(l));if(d){const h=d.stringify(l);if(typeof h!="string"||!us(h))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${h})`);return h}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return i(l);if(l&&typeof l=="object")return o(l)}function i(l,u){if(l.length===0)return"[]";let d="[";for(let h=0;h<l.length;h++){const b=l[h];typeof b<"u"&&typeof b!="function"?d+=r(b):d+="null",h<l.length-1&&(d+=",")}return d+="]",d}function o(l,u){if(typeof l.toJSON=="function")return bs(l.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(l);if(d.length===0)return"{}";let h=!0,b="{";for(const f of d){const w=l[f];if(a(f,w)){h?h=!1:b+=",";const p=JSON.stringify(f);b+=`${p}:`,b+=r(w)}}return b+="}",b}function a(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function _i(t){return Pe(t)&&!ds(t)?BigInt(t):parseFloat(t)}class _s{constructor(){ye(this,"id",1)}async exec(e,s,n={},r={},i=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return n.scope=window.openc3Scope,r.manual=!0,(await Xt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:s,id:this.id,keyword_params:n},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...r},timeout:i,transformRequest:[(o,a)=>bs(o)],transformResponse:[o=>Zr(o,void 0,_i)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a=o,a}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,s){return this.exec("map_target_to_interface",[e,s])}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...n){return this.exec("interface_cmd",[e,s,...n])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,s,n){return this.exec("get_item",[e,s,n])}get_param(e,s,n){return this.exec("get_param",[e,s,n])}get_parameter(e,s,n){return this.exec("get_param",[e,s,n])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(e){return this.exec("set_limits_set",[e])}get_target(e){return this.exec("get_target",[e])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(e,s){return this.exec("get_tlm",[e,s])}get_telemetry(e,s){return this.exec("get_tlm",[e,s])}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.exec("get_all_tlm",[e])}get_all_tlm_names(e,s=!1){return this.exec("get_all_tlm_names",[e],{hidden:s})}get_all_telemetry_names(e){return this.exec("get_all_tlm_names",[e])}get_all_tlm_item_names(e){return this.exec("get_all_tlm_item_names",[e])}async get_tlm_packet(e,s,n,r=30){const i=await this.exec("get_tlm_packet",[e,s],{type:n,stale_time:r});if(i!=null){let o=i.length,a=null;for(let l=0;l<o;l++)a=this.decode_openc3_type(i[l][1]),a!==null&&(i[l][1]=a)}return i}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}async get_tlm_values(e,s=30,n=null){let r={stale_time:s};n!==null&&(r.cache_timeout=n);const i=await this.exec("get_tlm_values",[e],r,{},1e4);let o=i[0].length,a=null;for(let l=0;l<o;l++)a=this.decode_openc3_type(i[0][l]),a!==null&&(i[0][l]=a);return i}get_limits(e,s,n){return this.exec("get_limits",[e,s,n])}async tlm(e,s,n,r="CONVERTED"){let i=null;if(s===void 0)i=await this.exec("tlm",[e]);else if(n===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))i=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else i=await this.exec("tlm",[e,s,n],{type:r});let o=this.decode_openc3_type(i);return o!==null&&(i=o),i}async inject_tlm(e,s,n=null,r="CONVERTED"){await this.exec("inject_tlm",[e,s,n],{type:r})}set_tlm(e,s,n,r){return this.exec("set_tlm",[e,s,n],{type:r})}override_tlm(e,s,n,r){return this.exec("override_tlm",[e,s,n],{type:r})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,s,n,r){return this.exec("normalize_tlm",[e,s,n],{type:r})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.exec("get_all_cmds",[e])}get_all_cmd_names(e,s=!1){return this.exec("get_all_cmd_names",[e],{hidden:s})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,s){return this.exec("get_cmd",[e,s])}get_command(e,s){return this.exec("get_cmd",[e,s])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,s,n,r="CONVERTED"){return this.exec("get_cmd_value",[e,s,n,r])}get_cmd_buffer(e,s){return this.exec("get_cmd_buffer",[e,s])}_cmd(e,s,n,r,i){let o=null;for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&(o=this.encode_openc3_type(r[a]),o!==null&&(r[a]=o));return this.exec(e,[s,n,r],{},i)}get_cmd_hazardous(e,s,n,r={}){return s===void 0?this.exec("get_cmd_hazardous",e,{},r):this._cmd("get_cmd_hazardous",e,s,n,r)}cmd(e,s,n,r={}){return s===void 0?this.exec("cmd",e,{},r):this._cmd("cmd",e,s,n,r)}cmd_no_range_check(e,s,n,r={}){return s===void 0?this.exec("cmd_no_range_check",e,{},r):this._cmd("cmd_no_range_check",e,s,n,r)}cmd_raw(e,s,n,r={}){return s===void 0?this.exec("cmd_raw",e,{},r):this._cmd("cmd_raw",e,s,n,r)}cmd_raw_no_range_check(e,s,n,r={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,{},r):this._cmd("cmd_raw_no_range_check",e,s,n,r)}cmd_no_hazardous_check(e,s,n,r={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,{},r):this._cmd("cmd_no_hazardous_check",e,s,n,r)}cmd_no_checks(e,s,n,r={}){return s===void 0?this.exec("cmd_no_checks",e,{},r):this._cmd("cmd_no_checks",e,s,n,r)}cmd_raw_no_hazardous_check(e,s,n,r={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},r):this._cmd("cmd_raw_no_hazardous_check",e,s,n,r)}cmd_raw_no_checks(e,s,n,r={}){return s===void 0?this.exec("cmd_raw_no_checks",e,{},r):this._cmd("cmd_raw_no_checks",e,s,n,r)}build_cmd(e,s,n){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,n)}build_command(e,s,n){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,n)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,n){return this.exec("save_config",[e,s,n])}delete_config(e,s){return this.exec("delete_config",[e,s])}enable_limits(e,s,n){return this.exec("enable_limits",[e,s,n])}disable_limits(e,s,n){return this.exec("disable_limits",[e,s,n])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(e){return this.exec("get_overall_limits_state",[e])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(e){return this.exec("get_setting",[e])}get_settings(e){return this.exec("get_settings",e)}set_setting(e,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}save_setting(e,s){return this.exec("set_setting",[e,s])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const s=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",s),r=new Uint8Array(n);return Array.from(r).map(i=>i.toString(16).padStart(2,"0")).join("")}}}const yi={components:{ValueWidget:ft,ValuelimitsbarWidget:pt},mixins:[Fe],props:{modelValue:{type:Array,default:()=>[]},timeZone:{type:String,default:"local"}},data(){return{api:null,cable:new ls,ignored:[],ignoredItemsDialog:!1,overallState:"GREEN",currentLimitsSet:"",items:[],itemList:[],screenItems:[],screenValues:{},updateCounter:0,itemsPerPage:25,search:"",headers:[{title:"Timestamp",key:"timestamp",width:"130px",sortable:!0,nowrap:!0},{title:"Item",key:"item",value:t=>t.parameters[2],sortable:!0,minWidth:"100px",width:"200px",maxWidth:"300px"},{title:"Value",key:"value",width:"380px",sortable:!1},{title:"Controls",key:"actions",width:"80px",sortable:!1},{title:"",key:"limits",sortable:!1}],valueLimitsBarWidgetSettings:[["WIDTH","380px"],["0","WIDTH","200px"],["1","WIDTH","180px"]],valueWidgetSettings:[["WIDTH","200px"]]}},computed:{textFieldClass(){return this.overallState?`textfield-${this.overallState.toLowerCase()}`:""},overallStateFormatted(){return this.ignored.length===0?this.overallState:`${this.overallState} (Some items ignored)`},ignoredFormatted(){return this.ignored.map(t=>t.split("__").join(" "))},astroStatus(){switch(this.overallState){case"GREEN":return"normal";case"YELLOW":return"caution";case"RED":return"critical";case"BLUE":return"standby";default:return null}}},created(){this.api=new _s;for(let t of this.modelValue)t.match(/.+__.+__.+/)?this.ignoreItem(t,!0):this.ignorePacket(t,!0);this.updateOutOfLimits(),this.getCurrentLimitsSet(),this.currentSetRefreshInterval=setInterval(this.getCurrentLimitsSet,10*1e3),this.cable.createSubscription("LimitsEventsChannel",window.openc3Scope,{received:t=>{this.cable.recordPing(),this.handleMessages(t)}}).then(t=>{this.limitsSubscription=t}),this.cable.createSubscription("ConfigEventsChannel",window.openc3Scope,{received:t=>{this.cable.recordPing();const e=JSON.parse(t);this.handleConfigEvents(e)}}).then(t=>{this.configSubscription=t})},mounted(){this.updater=setInterval(()=>{this.update()},1e3)},unmounted(){this.updater!=null&&(clearInterval(this.updater),this.updater=null),this.limitsSubscription&&this.limitsSubscription.unsubscribe(),this.configSubscription&&this.configSubscription.unsubscribe(),this.cable.disconnect()},methods:{getCurrentLimitsSet:function(){this.api.get_limits_set().then(t=>{this.currentLimitsSet=t})},updateOutOfLimits(){this.items=[],this.itemList=[],this.api.get_out_of_limits().then(t=>{for(const e of t){let s=e.join("__");if(this.ignored.find(r=>s.includes(r)))continue;this.itemList.push(s);let n={key:e.slice(0,3).join("__"),parameters:e.slice(0,3),timestamp:this.formatDateTime(new Date,this.timeZone)};e[3].includes("YELLOW")&&this.overallState!=="RED"&&(this.overallState="YELLOW"),e[3].includes("RED")&&(this.overallState="RED"),e[3]=="YELLOW"||e[3]=="RED"?n.limits=!1:n.limits=!0,this.items.push(n)}this.calcOverallState()})},calcOverallState(){let t="GREEN";for(let e of this.itemList)if(!this.ignored.find(s=>e.includes(s))&&(e.includes("YELLOW")&&t!=="RED"&&(t="YELLOW"),e.includes("RED"))){t="RED";break}this.overallState=t},ignorePacket(t,e){let[s,n,r]=t.split("__"),i=`${s}__${n}`;for(this.ignored.push(i),e||this.updateIgnored();;){let o=this.itemList.findIndex(a=>a.includes(i));if(o===-1)break;{let a=this.itemList[o].lastIndexOf("__");this.removeItem(this.itemList[o].substring(0,a))}}this.calcOverallState()},ignoreItem(t,e){this.ignored.push(t),e||this.updateIgnored(),this.removeItem(t),this.calcOverallState()},restoreItem(t){this.ignored.splice(t,1),this.updateIgnored(),this.updateOutOfLimits()},removeItem(t){const e=this.itemList.findIndex(s=>s.includes(t));this.items.splice(e,1),this.itemList.splice(e,1)},clearAll(){this.ignored=[],this.updateIgnored(),this.updateOutOfLimits()},updateIgnored(){this.$emit("update:modelValue",this.ignored)},handleConfigEvents(t){for(let e of t)e.kind==="deleted"&&e.type==="target"&&this.updateOutOfLimits()},handleMessages(t){for(let e of t){let s=JSON.parse(e.event);if(s.type!="LIMITS_CHANGE")continue;let n=`${s.target_name}__${s.packet_name}__${s.item_name}`;const r=this.itemList.findIndex(o=>o.includes(n));if(r!==-1){this.itemList[r]=`${n}__${s.new_limits_state}`,this.calcOverallState();continue}if(this.ignored.find(o=>n.includes(o))||s.new_limits_state&&!(s.new_limits_state.includes("YELLOW")||s.new_limits_state.includes("RED")))continue;let i={key:n,timestamp:this.formatNanoseconds(s.time_nsec,this.timeZone),parameters:[s.target_name,s.packet_name,s.item_name]};s.new_limits_state=="YELLOW"||s.new_limits_state=="RED"?i.limits=!1:i.limits=!0,this.itemList.push(`${n}__${s.new_limits_state}`),this.items.push(i),this.calcOverallState()}},update(){this.screenItems.length!==0&&this.api.get_tlm_values(this.screenItems).then(t=>{this.updateValues(t)})},updateValues:function(t){this.updateCounter+=1;for(let e=0;e<t.length;e++)t[e].push(this.updateCounter),this.screenValues[this.screenItems[e]]=t[e]},addItem:function(t){this.screenItems.push(t),this.screenValues[t]=[null,null,0]},deleteItem:function(t){let e=this.screenItems.indexOf(t);this.screenItems.splice(e,1)},showIgnored(){this.ignoredItemsDialog=!0},customFilter(t,e,s){if(!e||e.trim()==="")return!0;if(e=e.toLowerCase(),s.parameters&&s.parameters.length>0){for(const n of s.parameters)if(n.toLowerCase().includes(e))return!0}return!!(s.timestamp&&s.timestamp.toLowerCase().includes(e)||s.key&&s.key.toLowerCase().includes(e))}}},wi=["status"],vi={class:"font-weight-black"};function Si(t,e,s,n,r,i){const o=y("v-text-field"),a=y("v-spacer"),l=y("v-row"),u=y("valuelimitsbar-widget"),d=y("value-widget"),h=y("v-btn"),b=y("v-icon"),f=y("v-list-item-title"),w=y("v-list-item"),p=y("v-list"),I=y("v-menu"),R=y("v-data-table"),E=y("v-card"),O=y("v-toolbar"),V=y("v-divider"),_=y("v-card-text"),j=y("v-card-actions"),T=y("v-dialog");return k(),M("div",null,[g(E,{class:"pa-5"},{default:m(()=>[g(l,{class:"ma-1"},{default:m(()=>[g(o,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Overall Limits State","model-value":i.overallStateFormatted,class:$e(i.textFieldClass),style:{"margin-right":"10px","max-width":"280px"},"data-test":"overall-state"},_e({_:2},[i.astroStatus?{name:"prepend-inner",fn:m(()=>[F("rux-status",{status:i.astroStatus},null,8,wi)]),key:"0"}:void 0]),1032,["model-value","class"]),g(o,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Current Limits Set","model-value":r.currentLimitsSet,style:{"max-width":"200px"},"data-test":"limits-set"},null,8,["model-value"]),g(a),g(o,{modelValue:r.search,"onUpdate:modelValue":e[0]||(e[0]=x=>r.search=x),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",style:{"max-width":"300px"},"data-test":"search"},null,8,["modelValue"])]),_:1}),g(R,{"items-per-page":r.itemsPerPage,"onUpdate:itemsPerPage":e[1]||(e[1]=x=>r.itemsPerPage=x),headers:r.headers,items:r.items,search:r.search,"custom-filter":i.customFilter,"item-value":"key","data-test":"limits-table",class:"limits-table",density:"compact"},{"item.timestamp":m(({item:x})=>[P(J(x.timestamp),1)]),"item.value":m(({item:x})=>[x.limits?(k(),N(u,{key:0,parameters:x.parameters,settings:r.valueLimitsBarWidgetSettings,"screen-values":r.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"])):(k(),N(d,{key:1,parameters:x.parameters,settings:r.valueWidgetSettings,"screen-values":r.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"]))]),"item.actions":m(({item:x})=>[g(I,null,{activator:m(({props:L})=>[g(h,be({icon:"mdi-dots-horizontal",variant:"text",density:"compact","aria-label":"Item Options"},L),null,16)]),default:m(()=>[g(p,null,{default:m(()=>[g(w,{onClick:L=>i.ignorePacket(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[4]||(e[4]=[P("mdi-close-circle-multiple")])),_:1})]),default:m(()=>[g(f,null,{default:m(()=>e[5]||(e[5]=[P("Ignore Entire Packet")])),_:1})]),_:2},1032,["onClick"]),g(w,{onClick:L=>i.ignoreItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[6]||(e[6]=[P("mdi-close-circle")])),_:1})]),default:m(()=>[g(f,null,{default:m(()=>e[7]||(e[7]=[P("Ignore Item")])),_:1})]),_:2},1032,["onClick"]),g(w,{onClick:L=>i.removeItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[8]||(e[8]=[P("mdi-eye-off")])),_:1})]),default:m(()=>[g(f,null,{default:m(()=>e[9]||(e[9]=[P("Temporarily Hide Item")])),_:1})]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),"item.limits":m(({item:x})=>[g(a)]),_:1},8,["items-per-page","headers","items","search","custom-filter"]),e[10]||(e[10]=F("div",{class:"footer"},' Note: Timestamp is "now" for items currently out of limits when the page is loaded. ',-1))]),_:1}),g(T,{modelValue:r.ignoredItemsDialog,"onUpdate:modelValue":e[3]||(e[3]=x=>r.ignoredItemsDialog=x),"max-width":"600"},{default:m(()=>[g(E,null,{default:m(()=>[g(O,{height:"24"},{default:m(()=>[g(a),e[11]||(e[11]=F("span",null,"Ignored Items",-1)),g(a)]),_:1}),g(_,{class:"mt-2"},{default:m(()=>[F("div",null,[(k(!0),M(Z,null,ne(i.ignoredFormatted,(x,L)=>(k(),M("div",{key:L},[g(l,{class:"ma-1 align-center"},{default:m(()=>[F("span",vi,J(x),1),g(a),g(h,{icon:"mdi-delete",density:"compact",variant:"text","aria-label":"Remove Ignored Item","data-test":`remove-ignore-${L}`,onClick:De=>i.restoreItem(L)},null,8,["data-test","onClick"])]),_:2},1024),L<i.ignoredFormatted.length-1?(k(),N(V,{key:L})):Y("",!0)]))),128))])]),_:1}),g(j,{class:"px-2"},{default:m(()=>[g(h,{variant:"outlined",onClick:i.clearAll},{default:m(()=>e[12]||(e[12]=[P(" Clear All ")])),_:1},8,["onClick"]),g(a),g(h,{variant:"flat",onClick:e[2]||(e[2]=x=>r.ignoredItemsDialog=!1)},{default:m(()=>e[13]||(e[13]=[P(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Ei=ge(yi,[["render",Si],["__scopeId","data-v-ed7ec5ac"]]),xi={props:{historyCount:{type:Number,default:1e3},timeZone:{type:String,default:"local"}},mixins:[Fe],data(){return{data:[],cable:new ls,search:"",headers:[{title:"Time",value:"time_nsec",width:250},{title:"Level",value:"level",sortable:!1},{title:"Message",value:"message"}]}},created(){this.cable.createSubscription("LimitsEventsChannel",window.openc3Scope,{received:t=>{this.cable.recordPing(),this.handleMessages(t)}},{historyCount:1e3}).then(t=>{this.limitsSubscription=t})},unmounted(){this.limitsSubscription&&this.limitsSubscription.unsubscribe(),this.cable.disconnect()},methods:{handleMessages(t){for(let e=0;e<t.length;e++){let s=JSON.parse(t[e].event);this.data.unshift(s)}this.data.length>this.historyCount&&(this.data.length=this.historyCount)},getStatus(t){return t.includes("GREEN")?"normal":t.includes("YELLOW")?"caution":t.includes("RED")?"critical":t.includes("BLUE")?"standby":"off"},getColorClass(t){return t.includes("GREEN")?"openc3-green":t.includes("YELLOW")?"openc3-yellow":t.includes("RED")?"openc3-red":t.includes("BLUE")?"openc3-blue":this.$vuetify.theme.dark?"openc3-white":"openc3-black"},calcTableHeight(){return window.innerHeight-250}}},Ci=["status"];function Oi(t,e,s,n,r,i){const o=y("v-spacer"),a=y("v-text-field"),l=y("v-card-title"),u=y("v-data-table"),d=y("v-card");return k(),N(d,{class:"card-height"},{default:m(()=>[g(l,{class:"d-flex align-center"},{default:m(()=>[e[1]||(e[1]=P(" Limits Events ")),g(o),g(a,{modelValue:r.search,"onUpdate:modelValue":e[0]||(e[0]=h=>r.search=h),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),g(u,{headers:r.headers,items:r.data,search:r.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact",height:i.calcTableHeight(),hover:"","data-test":"limits-events"},{"item.time_nsec":m(({item:h})=>[F("span",null,J(t.formatNanoseconds(h.time_nsec,s.timeZone)),1)]),"item.level":m(({item:h})=>[F("rux-status",{status:i.getStatus(h.message)},null,8,Ci)]),"item.message":m(({item:h})=>[F("span",{class:$e(i.getColorClass(h.message))},J(h.message),3)]),_:1},8,["headers","items","search","height"])]),_:1})}const ki={components:{LimitsControl:Ei,LimitsEvents:ge(xi,[["render",Oi],["__scopeId","data-v-210db24e"]]),TopBar:xs,OpenConfigDialog:dt,SaveConfigDialog:ut},mixins:[lt],data(){return{title:"Limits Monitor",configKey:"limits_monitor",api:new _s,timeZone:"local",renderKey:0,ignored:[],openConfig:!1,saveConfig:!1,limitsSets:[],currentLimitsSet:null,currentSetRefreshInterval:null,limitsSetDialog:!1,menus:[{label:"File",items:[{label:"Show Ignored",icon:"mdi-magnify-close",command:()=>{this.$refs.control.showIgnored()}},{label:"Change Limits Set",icon:"mdi-swap-horizontal",command:()=>{this.limitsSetDialog=!0}},{divider:!0},{label:"Open Configuration",icon:"mdi-folder-open",command:()=>{this.openConfig=!0}},{label:"Save Configuration",icon:"mdi-content-save",command:()=>{this.saveConfig=!0}},{label:"Reset Configuration",icon:"mdi-monitor-shimmer",command:()=>{this.ignored=[],this.resetConfigBase(),this.renderKey++}}]}]}},created(){this.api.get_limits_sets().then(t=>{this.limitsSets=t}),this.api.get_setting("time_zone").then(t=>{t&&(this.timeZone=t)}).catch(t=>{})},mounted:function(){if(this.$route.query&&this.$route.query.config)this.openConfiguration(this.$route.query.config,!0);else{let t=this.loadDefaultConfig();JSON.stringify(t)!=="{}"&&(this.ignored=t,this.renderKey++)}},unmounted:function(){clearInterval(this.currentSetRefreshInterval)},methods:{setLimitsSet:function(){this.api.set_limits_set(this.currentLimitsSet),this.limitsSetDialog=!1,this.renderKey++},openConfiguration:function(t,e=!1){this.openConfigBase(t,e,s=>{this.ignored=s,this.renderKey++})},saveConfiguration:function(t){this.saveConfigBase(t,this.ignored)}}};function Ri(t,e,s,n,r,i){const o=y("top-bar"),a=y("limits-control"),l=y("limits-events"),u=y("open-config-dialog"),d=y("save-config-dialog"),h=y("v-spacer"),b=y("v-toolbar"),f=y("v-select"),w=y("v-card-text"),p=y("v-btn"),I=y("v-card-actions"),R=y("v-card"),E=y("v-dialog");return k(),M("div",null,[g(o,{menus:r.menus,title:r.title},null,8,["menus","title"]),(k(),N(a,{ref:"control",key:r.renderKey,modelValue:r.ignored,"onUpdate:modelValue":e[0]||(e[0]=O=>r.ignored=O),"time-zone":r.timeZone},null,8,["modelValue","time-zone"])),e[11]||(e[11]=F("div",{style:{height:"15px"}},null,-1)),g(l,{"time-zone":r.timeZone},null,8,["time-zone"]),r.openConfig?(k(),N(u,{key:0,modelValue:r.openConfig,"onUpdate:modelValue":e[1]||(e[1]=O=>r.openConfig=O),"config-key":r.configKey,onSuccess:i.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):Y("",!0),r.saveConfig?(k(),N(d,{key:1,modelValue:r.saveConfig,"onUpdate:modelValue":e[2]||(e[2]=O=>r.saveConfig=O),"config-key":r.configKey,onSuccess:i.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):Y("",!0),g(E,{modelValue:r.limitsSetDialog,"onUpdate:modelValue":e[5]||(e[5]=O=>r.limitsSetDialog=O),"max-width":"650"},{default:m(()=>[g(R,null,{default:m(()=>[g(b,{height:"24"},{default:m(()=>[g(h),e[6]||(e[6]=F("span",null,"Change Limits Set",-1)),g(h)]),_:1}),g(w,{class:"mt-6"},{default:m(()=>[e[7]||(e[7]=F("span",{style:{display:"block"}}," The Limits Set is a global option which changes the Limits Set across all tools. ",-1)),e[8]||(e[8]=F("span",{style:{display:"block"}}," NOTE: Changing this option clears the current list and recalculates based on the new set. ",-1)),g(f,{modelValue:r.currentLimitsSet,"onUpdate:modelValue":e[3]||(e[3]=O=>r.currentLimitsSet=O),label:"Limits Set",items:r.limitsSets,density:"compact",variant:"outlined","data-test":"limits-set","hide-details":"",class:"mt-3",style:{"max-width":"200px"}},null,8,["modelValue","items"])]),_:1}),g(I,{class:"px-2"},{default:m(()=>[g(h),g(p,{variant:"outlined",onClick:e[4]||(e[4]=O=>r.limitsSetDialog=!1)},{default:m(()=>e[9]||(e[9]=[P(" Cancel ")])),_:1}),g(p,{variant:"flat",onClick:i.setLimitsSet},{default:m(()=>e[10]||(e[10]=[P(" Ok ")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Ji=ws("default",ge(ki,[["render",Ri]]))}}});
|
6
|
+
`):" "+Ht(i[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Ye};function Ze(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ie(null,t)}function Kt(t){return Ze(t),t.headers=B.from(t.headers),t.data=Ke.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Jt.getAdapter(t.adapter||ue.adapter)(t).then(function(e){return Ze(t),e.data=Ke.call(t,t.transformResponse,e),e.headers=B.from(e.headers),e},function(e){return jt(e)||(Ze(t),e&&e.response&&(e.response.data=Ke.call(t,t.transformResponse,e.response),e.response.headers=B.from(e.response.headers))),Promise.reject(e)})}const Gt="1.9.0",Ie={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ie[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Yt={};Ie.transitional=function(t,e,s){function n(r,i){return"[Axios v"+Gt+"] Transitional option '"+r+"'"+i+(s?". "+s:"")}return(r,i,o)=>{if(t===!1)throw new v(n(i," has been removed"+(e?" in "+e:"")),v.ERR_DEPRECATED);return e&&!Yt[i]&&(Yt[i]=!0,console.warn(n(i," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,i,o):!0}},Ie.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function er(t,e,s){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const i=n[r],o=e[i];if(o){const a=t[i],l=a===void 0||o(a,i,t);if(l!==!0)throw new v("option "+i+" must be "+l,v.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new v("Unknown option "+i,v.ERR_BAD_OPTION)}}const Te={assertOptions:er,validators:Ie},K=Te.validators;let Q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Tt,response:new Tt}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const r=n.stack?n.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
7
|
+
`+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=X(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&Te.assertOptions(s,{silentJSONParsing:K.transitional(K.boolean),forcedJSONParsing:K.transitional(K.boolean),clarifyTimeoutError:K.transitional(K.boolean)},!1),n!=null&&(c.isFunction(n)?e.paramsSerializer={serialize:n}:Te.assertOptions(n,{encode:K.function,serialize:K.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Te.assertOptions(e,{baseUrl:K.spelling("baseURL"),withXsrfToken:K.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=r&&c.merge(r.common,r[e.method]);r&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),e.headers=B.concat(i,r);const o=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(a=a&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,d=0,h;if(!a){const f=[Kt.bind(this),void 0];for(f.unshift.apply(f,o),f.push.apply(f,l),h=f.length,u=Promise.resolve(e);d<h;)u=u.then(f[d++],f[d++]);return u}h=o.length;let b=e;for(d=0;d<h;){const f=o[d++],w=o[d++];try{b=f(b)}catch(p){w.call(this,p);break}}try{u=Kt.call(this,b)}catch(f){return Promise.reject(f)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=X(this.defaults,t);const e=$t(t.baseURL,t.url,t.allowAbsoluteUrls);return It(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Q.prototype[t]=function(e,s){return this.request(X(s||{},{method:t,url:e,data:(s||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function e(s){return function(n,r,i){return this.request(X(i||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Q.prototype[t]=e(),Q.prototype[t+"Form"]=e(!0)});let tr=class ys{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(r){s=r});const n=this;this.promise.then(r=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](r);n._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(r);return o.cancel=function(){n.unsubscribe(i)},o},e(function(r,i,o){n.reason||(n.reason=new ie(r,i,o),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const e=new AbortController,s=n=>{e.abort(n)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new ys(function(s){e=s}),cancel:e}}};function sr(t){return function(e){return t.apply(null,e)}}function nr(t){return c.isObject(t)&&t.isAxiosError===!0}const Xe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xe).forEach(([t,e])=>{Xe[e]=t});function Zt(t){const e=new Q(t),s=mt(Q.prototype.request,e);return c.extend(s,Q.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(n){return Zt(X(t,n))},s}const I=Zt(ue);I.Axios=Q,I.CanceledError=ie,I.CancelToken=tr,I.isCancel=jt,I.VERSION=Gt,I.toFormData=Ce,I.AxiosError=v,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=sr,I.isAxiosError=nr,I.mergeConfig=X,I.AxiosHeaders=B,I.formToJSON=t=>Nt(c.isHTMLForm(t)?new FormData(t):t),I.getAdapter=Jt.getAdapter,I.HttpStatusCode=Xe,I.default=I;const{Axios:Ii,AxiosError:Ti,CanceledError:Li,isCancel:Ni,CancelToken:Pi,VERSION:ji,all:Di,Cancel:Ui,isAxiosError:Fi,spread:$i,toFormData:Bi,AxiosHeaders:qi,HttpStatusCode:Vi,formToJSON:Mi,getAdapter:zi,mergeConfig:Wi}=I,Xt=I.create({baseURL:location.origin,timeout:6e4,params:{}});Xt.interceptors.response.use(t=>t,t=>{var e,s,n,r,i,o,a,l,u,d,h;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(w){w&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(n=(s=t.response)==null?void 0:s.config)!=null&&n.data&&(b+=`${t.response.config.data} `),(i=(r=t.response)==null?void 0:r.data)!=null&&i.message?b+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.error)!=null&&d.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(h=t.response)==null?void 0:h.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:b}),t}else throw t});let Le=()=>({emit(t,...e){for(let s=this.events[t]||[],n=0,r=s.length;n<r;n++)s[n](...e)},events:{},on(t,e){var s;return((s=this.events)[t]||(s[t]=[])).push(e),()=>{var n;this.events[t]=(n=this.events[t])==null?void 0:n.filter(r=>e!==r)}}});class he extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class Qe extends he{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class rr extends he{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class W extends he{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class ir extends W{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Qt(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let s=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${s}`}).join(",")}}`:""}class or{constructor(e){this.channel=e,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",e=>{if(e.type==="info"){this._state||(this._state=this.stateFromInfo(e));return}this._state&&(e.type==="join"?this._state[e.id]=e.info:e.type==="leave"&&delete this._state[e.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(e=>e()),this.listeners.length=0}async join(e,s){if(!this._info)return this._info={id:e,info:s},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let e=await this.channel.perform("$presence:leave");return delete this._info,e}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let e=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(e),this._state}finally{delete this._promise}}stateFromInfo(e){return e.records.reduce((s,{id:n,info:r})=>(s[n]=r,s),{})}}const ee=Symbol("state");class es{constructor(e={}){this.emitter=Le(),this.params=Object.freeze(e),this.presence=new or(this),this.initialConnect=!0,this[ee]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Qt({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[ee]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[ee]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[ee]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[ee]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[ee]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[ee]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let n=this.receiver?this.receiver.logger:null;n&&n.warn("whisper failed: ",s)}}receive(e,s){this.emit("message",e,s)}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}emit(e,...s){return this.emitter.emit(e,...s)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((e,s)=>{let n=[()=>delete this._pendingSubscribe];n.push(this.on("connect",()=>{n.forEach(r=>r()),e()})),n.push(this.on("close",r=>{n.forEach(i=>i()),s(r||new he("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class ar{constructor(e){this.id=e,this.intent="unsubscribed",this.state="idle",this.channels=[],this.disposed=!1,this._pendings=[]}add(e){this.channels.includes(e)||this.channels.push(e)}remove(e){let s=this.channels.indexOf(e);s>-1&&this.channels.splice(s,1)}notify(e,...s){this.state=e==="restored"?"connected":e,s.length===1?this.channels.forEach(n=>n[e](s[0])):this.channels.forEach(n=>n[e]())}pending(e){this._checkIntent(e);let s=this._pendings[0];return!s||s.intent!==e?Promise.resolve():s.promise}ensureResubscribed(){this.disposed||(this.intent=void 0,this.ensureSubscribed())}ensureSubscribed(){if(this.intent!=="subscribed"){if(this.disposed)throw Error("Subscription is disposed");this.intent="subscribed",!this._mergeWithPending("unsubscribed")&&this.subscriber(this)}}maybeUnsubscribe(){this.disposed||this.intent==="unsubscribed"||this.channels.length>0||(this.intent="unsubscribed",this._mergeWithPending("subscribed"))||this.unsubscriber(this)}async acquire(e){this._checkIntent(e);let s,n={promise:new Promise(i=>{s=i}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(n),1),s(n)},canceled:!1,acquired:!1},r=this._pendingTop;return this._pendings.push(n),r&&await r.promise,this.gvl&&await this.gvl.acquire(n,e),n.acquired=!0,n}close(e){this.disposed=!0,this.intent=void 0,this.notify("closed",e)}_checkIntent(e){if(!(e==="unsubscribed"||e==="subscribed"))throw Error(`Unknown subscription intent: ${e}`)}get _pendingTop(){return this._pendings.length?this._pendings[this._pendings.length-1]:void 0}_mergeWithPending(e){let s=this._pendingTop;return!s||s.acquired||s.intent!==e?!1:(this._pendings.pop(),s.canceled=!0,!0)}}class cr{constructor(){this.queue=[]}async acquire(e,s){s==="subscribed"&&(this.queue.push(e.promise.then(()=>{this.queue.splice(this.queue.indexOf(e),1)})),this.queue.length>1&&await this.queue[this.queue.length-2])}}class lr{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new cr),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:s,unsubscribe:n}){let r=this._subscriptions[e]=new ar(e);return r.remoteId=this._localToRemote[e],r.subscriber=s,r.unsubscriber=n,r.gvl=this.glv,r}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,s){this._localToRemote[e]=s;let n=this.get(e);n&&(n.remoteId=s)}}class ur{constructor(e={}){this.subscriptions=new lr(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,s){this._remoteToLocal[s]=e,this.subscriptions.storeRemoteId(e,s),this.flush(s)}unsubscribe(e){let s=this.subscriptions.get(e);if(!s)return;let n=s.remoteId;n&&delete this._remoteToLocal[n],this.subscriptions.remove(e)}transmit(e,s,n){let r=this._remoteToLocal[e];if(!r){this._pendingMessages.push([e,s,n]);return}let i=this.subscriptions.get(r);i&&i.channels.forEach(o=>{o.receive(s,n)})}notify(e,s,n){let r=this._remoteToLocal[e];if(!r)return;let i=this.subscriptions.get(r);i&&i.channels.forEach(o=>o.emit(s,n))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let s=[];for(let n of this._pendingMessages)n[0]===e?this.transmit(n[0],n[1],n[2]):s.push(n);this._pendingMessages=s}}const ts={debug:0,info:1,warn:2,error:3};class ss{constructor(e){this.level=e||"warn"}log(e,s,n){ts[e]<ts[this.level]||this.writeLogEntry(e,s,n)}writeLogEntry(){throw Error("Not implemented")}debug(e,s){this.log("debug",e,s)}info(e,s){this.log("info",e,s)}warn(e,s){this.log("warn",e,s)}error(e,s){this.log("error",e,s)}}class fe extends ss{writeLogEntry(){}}class dr{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let hr=0;class ns{constructor(e={}){let{logger:s}=e;this.logger=s||new fe,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,s){let n={channel:e};s&&Object.assign(n,s);let r=Qt(n);if(this.pendingUnsubscriptions[r]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,r),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},o)})}if(this.pendingSubscriptions[r])return this.logger.warn("subscription is already pending, skipping",r),Promise.reject(Error("Already subscribing"));let i=this.subscribeRetryInterval;return new Promise((o,a)=>{let l=++hr;this.pendingSubscriptions[r]={resolve:o,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(r)),this.maybeRetrySubscribe(l,r,i)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,s,n){setTimeout(()=>{let r=this.pendingSubscriptions[s];r&&r.id===e&&(this.logger.warn(`no subscription ack received in ${n}ms, retrying subscribe`,s),this.cable.send(this.buildSubscribeRequest(s)),this.maybeExpireSubscribe(e,s,n))},n)}maybeExpireSubscribe(e,s,n){setTimeout(()=>{let r=this.pendingSubscriptions[s];r&&r.id===e&&(delete this.pendingSubscriptions[s],r.reject(new rr(`Haven't received subscription ack in ${n*2}ms for ${s}`)))},n)}unsubscribe(e){return this.cable.send({command:"unsubscribe",identifier:e}),this.pendingUnsubscriptions[e]=!0,setTimeout(()=>{delete this.pendingUnsubscriptions[e]},this.subscribeCooldownInterval),Promise.resolve()}perform(e,s,n){return s==="$whisper"?this.whisper(e,n):(n||(n={}),n.action=s,this.cable.send({command:"message",identifier:e,data:JSON.stringify(n)}),Promise.resolve())}whisper(e,s){return this.cable.send({command:"whisper",identifier:e,data:s}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:n,message:r,reason:i,reconnect:o}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new W(i);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[n];if(!a){this.logger.error("subscription not found, unsubscribing",{type:s,identifier:n}),this.unsubscribe(n);return}return delete this.pendingSubscriptions[n],a.resolve(n)}if(s==="reject_subscription"){let a=this.pendingSubscriptions[n];return a?(delete this.pendingSubscriptions[n],a.reject(new Qe)):this.logger.error("subscription not found",{type:s,identifier:n})}if(r)return{identifier:n,message:r};this.logger.warn(`unknown message type: ${s}`,{message:e})}reset(e){for(let s in this.pendingSubscriptions)this.pendingSubscriptions[s].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const rs=()=>Date.now()/1e3|0;class fr extends ns{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=rs()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let s in this.pendingPresence)this.pendingPresence[s].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:n,message:r}=e;if(s==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(s==="reject_subscription")return super.receive(e);if(s==="confirm_subscription")return this.subscriptionStreams[n]||(this.subscriptionStreams[n]=new Set),super.receive(e);if(s==="ping")return this.restoreSince&&(this.restoreSince=rs()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",n);return}if(s==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",n);return}if(s==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let i=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of i)this.cable.send({identifier:o,command:"history",history:this.historyRequestFor(o)}),this.presenceInfo[o]&&this.cable.send({identifier:o,command:"join",presence:this.presenceInfo[o]});return this.cable.restored(i)}return this.cable.connected(this.sessionId)}if(s==="presence"){let i=r.type;if(i==="info"){let o=this.pendingPresence[n];o&&(delete this.pendingPresence[n],o.resolve(r))}else if(i==="error"){let o=this.pendingPresence[n];o&&(delete this.pendingPresence[n],o.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:n,message:r}}if(r){let i=this.trackStreamPosition(n,e.stream_id,e.epoch,e.offset);return{identifier:n,message:r,meta:i}}this.logger.warn(`unknown message type: ${s}`,{message:e})}perform(e,s,n){switch(s){case"$presence:join":return this.join(e,n);case"$presence:leave":return this.leave(e,n);case"$presence:info":return this.presence(e,n)}return super.perform(e,s,n)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let s=super.buildSubscribeRequest(e),n=this.historyRequestFor(e);n&&(s.history=n,this.pendingHistory[e]=!0);let r=this.presenceInfo[e];return r&&(s.presence=r),s}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let s={},n=!1;if(this.subscriptionStreams[e])for(let r of this.subscriptionStreams[e]){let i=this.streamsPositions[r];i&&(n=!0,s[r]=i)}if(!(!n&&!this.restoreSince))return{since:this.restoreSince,streams:s}}trackStreamPosition(e,s,n,r){if(!(!s||!n))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(s),this.streamsPositions[s]={epoch:n,offset:r},{stream:s,epoch:n,offset:r}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,s){return this.presenceInfo[e]=s,this.cable.send({command:"join",identifier:e,presence:s}),Promise.resolve()}async leave(e,s){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:s}),Promise.resolve()}presence(e,s){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((n,r)=>{this.pendingPresence[e]={resolve:n,reject:r},this.cable.send({command:"presence",identifier:e,data:s})})}}class pr extends he{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class et extends es{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ye(et,"identifier","__ghost__");const mr="$pubsub";class tt extends es{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}ye(tt,"identifier",mr);const te=Symbol("state");let gr=class{constructor({transport:t,protocol:e,encoder:s,logger:n,lazy:r,hubOptions:i,performFailures:o,transportConfigurator:a}){this.emitter=Le(),this.transport=t,this.encoder=s,this.logger=n||new fe,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new ur(i||{}),this[te]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,r===!1&&this.connect().catch(()=>{})}get state(){return this[te]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[te]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[te]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new W("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[te]="connected",this.hub.subscriptions.all().forEach(n=>{t&&n.remoteId&&t.includes(n.remoteId)?n.notify("restored"):(n.notify("disconnected",new W("recovery_failed")),this._resubscribe(n))});let e=!this.initialConnect,s=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:s})}notify(t,e,s){e&&typeof e!="string"&&(s=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:s}):this.emit("info",{type:t,data:s})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new W(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[te]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof W?t:new W(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[te]="closed";let s=e||new W("cable_closed");this.hub.subscriptions.all().forEach(n=>n.notify("disconnected",s)),this.hub.close(),this.protocol.reset(),this.transport.close(),this.initialConnect=!0,this.emit("close",e)}disconnect(){this.closed()}handleIncoming(t){if(this.state==="closed"||this.state==="idle")return;let e=this.encoder.decode(t);if(e===void 0){this.logger.error("failed to decode message",{message:t});return}this.logger.debug("incoming data",e);let s=this.protocol.receive(e);if(s){this.logger.debug("processed incoming message",s);let{type:n,identifier:r,message:i,meta:o}=s;n?this.hub.notify(r,n,i):this.hub.transmit(r,i,o)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new tt({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new tt({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,n;return typeof t=="string"&&(n=t,t=et),s=n?new t(n,e):new t(e),this.subscribe(s)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let s=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:n=>this._subscribe(n,t.channelId,t.params),unsubscribe:n=>this._unsubscribe(n)});return s.add(t),s.intent==="subscribed"&&s.state==="connected"&&t.connected(),s.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,s){let n=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:n});return}this.logger.debug("acquiring subscribe lock",{identifier:n});let r=await t.acquire("subscribed");if(r.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:n}),r.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:n}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),r.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:n}),r.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:n}),t.notify("connected"),r.release();return}let i={identifier:e,params:s};this.logger.debug("subscribing",i);try{let o=await this.protocol.subscribe(e,s);this.hub.subscribe(n,o),this.logger.debug("subscribed",{...i,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof Qe&&this.logger.warn("rejected",i),o instanceof W){this.logger.debug("disconnected during subscription; will retry on connect",i),r.release();return}this.logger.error("failed to subscribe",{error:o,...i})}t.close(o),this.hub.unsubscribe(n)}r.release()}unsubscribe(t){let e=t.identifier,s=this.hub.subscriptions.get(e);if(!s)throw Error(`Subscription not found: ${e}`);s.remove(t),t.closed(),s.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let s=await t.acquire("unsubscribed");if(s.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),s.release();return}if(this.logger.debug("unsubscribe lock has been acquired",{identifier:e}),t.intent!=="unsubscribed"){this.logger.debug("cancel unsubscribe, no longer needed",{identifier:e,intent:t.intent}),s.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),s.release();return}let n=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:n}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),s.release();return}try{await this.protocol.unsubscribe(n),this.logger.debug("unsubscribed remotely",{id:e})}catch(r){r&&(r instanceof W?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:r}):this.logger.error("unsubscribe failed",{id:e,error:r}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",s.release()}async perform(t,e,s){if(this.performFailures==="throw")return this._perform(t,e,s);try{return await this._perform(t,e,s)}catch(n){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:n});return}}async _perform(t,e,s){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new pr;let n=this.hub.subscriptions.get(t);if(!n)throw Error(`Subscription not found: ${t}`);if(await n.pending("subscribed"),n.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let r=n.remoteId,i={id:r,action:e,payload:s};this.logger.debug("perform",i);try{let o=await this.protocol.perform(r,e,s);return o&&this.logger.debug("perform result",{message:o,request:i}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:i}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...n)=>{s(),e(...n)});return s}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let s=[()=>delete this._pendingConnect];s.push(this.on("connect",()=>{s.forEach(n=>n()),t()})),s.push(this.on("close",n=>{s.forEach(r=>r()),e(n)})),s.push(this.on("disconnect",n=>{s.forEach(r=>r()),e(n)}))}),this._pendingConnect)}};const br={maxMissingPings:2,maxReconnectAttempts:1/0},oe=()=>Date.now(),is=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:n,maxInterval:r}=e;return s=s||2,n===void 0&&(n=.5),i=>{let o=t*s**i,a=o*s,l=o+(a-o)*Math.random(),u=2*(Math.random()-.5)*n;return l=l*(1+u),r&&r<l&&(l=r),l}};let os=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},br,e),this.strategy=e.reconnectStrategy,!this.strategy)throw Error("Reconnect strategy must be provided");this.maxMissingPings=e.maxMissingPings,this.maxReconnectAttempts=e.maxReconnectAttempts,this.logger=e.logger||new fe,this.state="pending_connect",this.attempts=0,this.disconnectedAt=oe()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=oe(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=oe(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=oe(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=oe()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=oe()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new ir))}scheduleReconnect(){if(this.attempts>=this.maxReconnectAttempts){this.target.close();return}let t=this.strategy(this.attempts);this.attempts++,this.logger.info(`Reconnecting in ${t}ms (${this.attempts} attempt)`),this.state="pending_reconnect",this.reconnnectId=setTimeout(()=>this.reconnectNow(),t)}cancelReconnect(){this.reconnnectId&&(clearTimeout(this.reconnnectId),delete this.reconnnectId)}};class _r{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Le(),this.unbind=[],this.logger=s.logger||new fe}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let s=this.transports[e];try{this.transport=s,this.resetListeners(),this.logger.debug(`Trying to connect via ${s.displayName()}`),await s.open(),this.logger.debug(`Connected via ${s.displayName()}`);return}catch(n){this.logger.debug(`Failed to connect via ${s.displayName()}: ${n.message}`)}}throw this.transport=null,this.resetListeners(),new Error("Couldn't connect via any available transport")}send(e){if(!this.transport)throw new Error("No transport is open");this.transport.send(e)}async close(){if(!this.transport)throw new Error("No transport is open");await this.transport.close(),this.transport=null}setURL(){throw new Error("Not implemented. Set URL for each transport separately")}setParam(e,s){this.transports.forEach(n=>{n.setParam(e,s)})}setToken(e,s){this.transports.forEach(n=>{n.setToken(e,s)})}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}get url(){return this.transport?this.transport.url:""}resetListeners(){this.unbind.forEach(e=>e()),this.unbind.length=0,this.transport&&this.unbind.push(this.transport.on("open",()=>{this.emitter.emit("open")}),this.transport.on("data",e=>{this.emitter.emit("data",e)}),this.transport.on("close",e=>{this.emitter.emit("close",e)}),this.transport.on("error",e=>{this.emitter.emit("error",e)}))}}class yr{constructor(e,s={}){this.url=e;let n=s.websocketImplementation;if(n)this.Impl=n;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Le();let{format:r,subprotocol:i,authStrategy:o}=s;this.format=r||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=i}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((s,n)=>{let r=[];r.push(this.once("open",()=>{r.forEach(i=>i()),s()})),r.push(this.once("close",()=>{r.forEach(i=>i()),n(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,s){let n=new URL(this.url);n.searchParams.set(e,s);let r=`${n.protocol}//${n.host}${n.pathname}?${n.searchParams}`;this.setURL(r)}setToken(e,s="jid"){if(this.authStrategy==="param")this.setParam(s,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let n=`x-${s}`.toLowerCase();n=Object.keys(this.connectionOptions.headers).find(r=>r.toLowerCase()===n)||n,this.connectionOptions.headers[n]=e}else if(this.authStrategy==="sub-protocol")this.authProtocol=`anycable-token.${e}`;else throw new Error("Unknown auth strategy: "+this.authStrategy)}send(e){if(!this.ws||!this.connected)throw Error("WebSocket is not connected");this.ws.send(e)}close(){this.ws?this.onclose():this.connected=!1}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}initListeners(){this.ws.onerror=e=>{this.connected&&this.emitter.emit("error",e.error||new Error("WS Error"))},this.ws.onclose=()=>{this.onclose()},this.ws.onmessage=e=>{let s=e.data;this.format==="binary"&&(s=new Uint8Array(s)),this.emitter.emit("data",s)},this.ws.onopen=()=>{this.connected=!0,this.emitter.emit("open")}}onclose(){this.ws.onclose=void 0,this.ws.onmessage=void 0,this.ws.onopen=void 0,this.ws.close(),delete this.ws,this.connected=!1,this.emitter.emit("close")}}const as={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function wr(t,e){if(typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),e=e||{},!t&&!e.transport)throw Error("URL or transport must be specified");e=Object.assign({},as,e);let{protocol:s,websocketImplementation:n,websocketFormat:r,websocketOptions:i,websocketAuthStrategy:o,fallbacks:a,logLevel:l,logger:u,transport:d,encoder:h,lazy:b,monitor:f,pingInterval:w,reconnectStrategy:p,maxMissingPings:A,maxReconnectAttempts:R,subprotocol:E,tokenRefresher:O,historyTimestamp:V,protocolOptions:_,concurrentSubscribes:j,performFailures:T,transportConfigurator:x,auth:L}=e;if(u=u||new fe(l),typeof s=="string"){E=E||s;let ae=s.substring(0,s.lastIndexOf("-")),q=s.substring(s.lastIndexOf("-")+1);if(_=_||{},ae==="actioncable-v1")s=new ns({logger:u,..._});else if(ae==="actioncable-v1-ext")s=new fr({logger:u,historyTimestamp:V,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(q==="json")h=h||new dr,r=r||"text";else if(q==="msgpack"){if(r="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(q==="protobuf"){if(r=r||"binary",!h)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${s}`)}if(!s)throw Error("Protocol must be specified");d=d||new yr(t,{websocketImplementation:n,websocketOptions:i,subprotocol:E,authStrategy:o,format:r}),a&&(d=new _r([d,...a],{logger:u})),L&&L.token&&d.setToken(L.token,L.param||"jid"),p=p||is(w),f!==!1&&(f=f||new os({pingInterval:w,reconnectStrategy:p,maxMissingPings:A,maxReconnectAttempts:R,logger:u}));let Ue={concurrentSubscribes:j},H=new gr({protocol:s,transport:d,encoder:h,logger:u,lazy:b,hubOptions:Ue,performFailures:T,transportConfigurator:x});return f&&(f.watch(H),H.monitor=f),O&&vr(H,async()=>{try{await O(d)}catch(ae){return u.error("Failed to refresh authentication token: "+ae),!1}return H.connect().catch(()=>{}),!0}),H}function vr(t,e){let s=!1;t.on("connect",()=>s=!1),t.on("close",async n=>{if(n){if(s){t.logger.warn("Token auto-refresh is disabled",n);return}n.reason==="token_expired"&&(s=!0,await e())}})}class Sr{constructor(e){this.channel=e}notify(e,...s){typeof this[e]=="function"&&this[e](...s)}perform(e,s={}){this.channel.perform(e,s)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class Er extends et{constructor(e,s,n){super(e,s),this.subscription=new Sr(this),Object.assign(this.subscription,n),this.on("connect",({reconnect:r})=>this.subscription.notify("connected",{reconnected:r})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",r=>this.subscription.notify("received",r)),this.on("close",r=>{r&&r instanceof Qe?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class xr{constructor(e){this.cable=e}create(e,s){let n,r;typeof e=="object"?(n=e.channel,delete e.channel,r=e):(n=e,r={});let i=new Er(n,r,s);return i.subscription.notify("initialized"),this.cable.subscribe(i),i.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class Cr{constructor(e){this.cable=e,this.subscriptions=new xr(e)}}class Or extends ss{writeLogEntry(e,s,n){n?console[e](s,n):console[e](s)}}class kr extends os{watch(e){super.watch(e),this.initActivityListeners()}initActivityListeners(){if(typeof document<"u"&&typeof window<"u"&&document.addEventListener&&window.addEventListener){let e=()=>{document.hidden||this.reconnectNow()&&this.logger.debug("Trigger reconnect due to visibility change")},s=r=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:r})},n=()=>this.disconnect(new W("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",n,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",s,!1),window.removeEventListener("online",s,!1),window.removeEventListener("resume",s,!1),window.removeEventListener("freeze",n,!1)})}}disconnect(e){this.state==="disconnected"||this.state==="closed"||(this.logger.info("Disconnecting",{reason:e.message}),this.cancelReconnect(),this.stopPolling(),this.state="pending_disconnect",this.target.disconnected(e))}}const Rr=["cable","action-cable"],Ar="/cable",Ne=(t,e)=>{for(let s of Rr){let n=t.head.querySelector(`meta[name='${s}-${e}']`);if(n)return n.getAttribute("content")}},cs=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Ir=()=>{if(typeof document<"u"&&document.head){let t=Ne(document,"url");if(t)return cs(t)}return cs(Ar)},Tr=()=>{if(typeof document<"u"&&document.head){let t=Ne(document,"history-timestamp");if(t)return t|0}},Lr=()=>{if(typeof document<"u"&&document.head)return Ne(document,"token")},Nr=()=>{if(typeof document<"u"&&document.head)return Ne(document,"token-param")};function Pr(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Ir(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Tr());let s=Lr();if(s){let u=Nr();e.auth=Object.assign({token:s,param:u},e.auth||{})}e=Object.assign({},as,e);let{logLevel:n,logger:r,pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l}=e;return r=e.logger=e.logger||new Or(n),o=e.reconnectStrategy=e.reconnectStrategy||is(i),e.monitor!==!1&&(e.monitor=e.monitor||new kr({pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l,logger:r})),wr(t,e)}function jr(t,e){let s=Pr(t,e);return new Cr(s)}class ls{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,n={},r={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(i=>{if(i&&OpenC3Auth.setTokens(),this._cable==null){let o=this._url+"?scope="+encodeURIComponent(window.openc3Scope)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=jr(o)}return this._cable.subscriptions.create({channel:e,...r},n)})}recordPing(){}}function Pe(t){return Dr.test(t)}const Dr=/^-?[0-9]+$/;function us(t){return Ur.test(t)}const Ur=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ds(t,e){const s=Number.parseFloat(t),n=String(s),r=hs(t),i=hs(n);return!!(r===i||(e==null?void 0:e.approx)===!0&&!Pe(t)&&i.length>=14&&r.startsWith(i.substring(0,14)))}let pe=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Fr(t){if(ds(t,{approx:!1}))return;if(Pe(t))return pe.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?pe.underflow:pe.truncate_float:pe.overflow}function hs(t){return t.replace($r,"").replace(qr,"").replace(Vr,"").replace(Br,"")}const $r=/[eE][+-]?\d+$/,Br=/^-?(0*)?/,qr=/\./,Vr=/0+$/;class Mr{constructor(e){if(ye(this,"isLosslessNumber",!0),!us(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Fr(this.value);if(e===void 0||e===pe.truncate_float)return Number.parseFloat(this.value);if(Pe(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function zr(t){return t&&typeof t=="object"&&t.isLosslessNumber===!0||!1}function Wr(t){return new Mr(t)}function Hr(t,e){return st({"":t},"",t,e)}function st(t,e,s,n){return Array.isArray(s)?n.call(t,e,Kr(s,n)):s&&typeof s=="object"&&!zr(s)?n.call(t,e,Jr(s,n)):n.call(t,e,s)}function Jr(t,e){for(const s of Object.keys(t)){const n=st(t,s,t[s],e);n!==void 0?t[s]=n:delete t[s]}return t}function Kr(t,e){for(let s=0;s<t.length;s++)t[s]=st(t,String(s),t[s],e);return t}function Gr(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wr,n=0;const r=a();return w(r),A(),e?Hr(r,e):r;function i(){if(t.charCodeAt(n)===ti){n++,u();const S={};let D=!0;for(;n<t.length&&t.charCodeAt(n)!==ps;){D?D=!1:(b(),u());const se=n,me=d();if(me===void 0){O();return}u(),f();const at=a();if(at===void 0){L();return}Object.prototype.hasOwnProperty.call(S,me)&&!nt(at,S[me])&&V(me,se+1),S[me]=at}return t.charCodeAt(n)!==ps&&_(),n++,S}}function o(){if(t.charCodeAt(n)===si){n++,u();const S=[];let D=!0;for(;n<t.length&&t.charCodeAt(n)!==ms;){D?D=!1:b();const se=a();p(se),S.push(se)}return t.charCodeAt(n)!==ms&&j(),n++,S}}function a(){u();const S=d()??h()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),S}function l(S,D){if(t.slice(n,n+S.length)===S)return n+=S.length,D}function u(){for(;Yr(t.charCodeAt(n));)n++}function d(){if(t.charCodeAt(n)===rt){n++;let S="";for(;n<t.length&&t.charCodeAt(n)!==rt;){if(t.charCodeAt(n)===ei){const D=t[n+1],se=Qr[D];se!==void 0?(S+=se,n++):D==="u"?je(t.charCodeAt(n+2))&&je(t.charCodeAt(n+3))&&je(t.charCodeAt(n+4))&&je(t.charCodeAt(n+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(n+2,n+6),16)),n+=5):Ue(n):x(n)}else Xr(t.charCodeAt(n))?S+=t[n]:T(t[n]);n++}return E(),n++,S}}function h(){const S=n;if(t.charCodeAt(n)===gs&&(n++,R(S)),t.charCodeAt(n)===it)n++;else if(Zr(t.charCodeAt(n)))for(n++;De(t.charCodeAt(n));)n++;if(t.charCodeAt(n)===ui)for(n++,R(S);De(t.charCodeAt(n));)n++;if(t.charCodeAt(n)===mi||t.charCodeAt(n)===pi)for(n++,(t.charCodeAt(n)===gs||t.charCodeAt(n)===ai)&&n++,R(S);De(t.charCodeAt(n));)n++;if(n>S)return s(t.slice(S,n))}function b(){if(t.charCodeAt(n)!==li)throw new SyntaxError(`Comma ',' expected after value ${q()}`);n++}function f(){if(t.charCodeAt(n)!==di)throw new SyntaxError(`Colon ':' expected after property name ${q()}`);n++}function w(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${q()}`)}function p(S){if(S===void 0)throw new SyntaxError(`Array item expected ${q()}`)}function A(){if(n<t.length)throw new SyntaxError(`Expected end of input ${q()}`)}function R(S){if(!De(t.charCodeAt(n))){const D=t.slice(S,n);throw new SyntaxError(`Invalid number '${D}', expecting a digit ${q()}`)}}function E(){if(t.charCodeAt(n)!==rt)throw new SyntaxError(`End of string '"' expected ${q()}`)}function O(){throw new SyntaxError(`Quoted object key expected ${q()}`)}function V(S,D){throw new SyntaxError(`Duplicate key '${S}' encountered at position ${D}`)}function _(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${q()}`)}function j(){throw new SyntaxError(`Array item or end of array ']' expected ${q()}`)}function T(S){throw new SyntaxError(`Invalid character '${S}' ${H()}`)}function x(S){const D=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${D}' ${H()}`)}function L(){throw new SyntaxError(`Object value expected after ':' ${H()}`)}function Ue(S){const D=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${D}' ${H()}`)}function H(){return`at position ${n}`}function ae(){return n<t.length?`but got '${t[n]}'`:"but reached end of input"}function q(){return`${ae()} ${H()}`}}function Yr(t){return t===ni||t===ri||t===ii||t===oi}function je(t){return t>=it&&t<=ot||t>=hi&&t<=gi||t>=fi&&t<=bi}function De(t){return t>=it&&t<=ot}function Zr(t){return t>=ci&&t<=ot}function Xr(t){return t>=32&&t<=1114111}function nt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,n)=>nt(s,e[n])):fs(t)&&fs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>nt(t[s],e[s])):!1}function fs(t){return typeof t=="object"&&t!==null}const Qr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
8
|
+
`,r:"\r",t:" "},ei=92,ti=123,ps=125,si=91,ms=93,ni=32,ri=10,ii=9,oi=13,rt=34,ai=43,gs=45,it=48,ci=49,ot=57,li=44,ui=46,di=58,hi=65,fi=97,pi=69,mi=101,gi=70,bi=102;function bs(t,e,s,n){return r(t);function r(l,u){if(Array.isArray(n)){const d=n.find(h=>h.test(l));if(d){const h=d.stringify(l);if(typeof h!="string"||!us(h))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${h})`);return h}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return i(l);if(l&&typeof l=="object")return o(l)}function i(l,u){if(l.length===0)return"[]";let d="[";for(let h=0;h<l.length;h++){const b=l[h];typeof b<"u"&&typeof b!="function"?d+=r(b):d+="null",h<l.length-1&&(d+=",")}return d+="]",d}function o(l,u){if(typeof l.toJSON=="function")return bs(l.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(l);if(d.length===0)return"{}";let h=!0,b="{";for(const f of d){const w=l[f];if(a(f,w)){h?h=!1:b+=",";const p=JSON.stringify(f);b+=`${p}:`,b+=r(w)}}return b+="}",b}function a(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function _i(t){return Pe(t)&&!ds(t)?BigInt(t):parseFloat(t)}class _s{constructor(){ye(this,"id",1)}async exec(e,s,n={},r={},i=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return n.scope=window.openc3Scope,r.manual=!0,(await Xt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:s,id:this.id,keyword_params:n},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...r},timeout:i,transformRequest:[(o,a)=>bs(o)],transformResponse:[o=>Gr(o,void 0,_i)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a=o,a}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,s){return this.exec("map_target_to_interface",[e,s])}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...n){return this.exec("interface_cmd",[e,s,...n])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,s,n){return this.exec("get_item",[e,s,n])}get_param(e,s,n){return this.exec("get_param",[e,s,n])}get_parameter(e,s,n){return this.exec("get_param",[e,s,n])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(e){return this.exec("set_limits_set",[e])}get_target(e){return this.exec("get_target",[e])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(e,s){return this.exec("get_tlm",[e,s])}get_telemetry(e,s){return this.exec("get_tlm",[e,s])}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.exec("get_all_tlm",[e])}get_all_tlm_names(e,s=!1){return this.exec("get_all_tlm_names",[e],{hidden:s})}get_all_telemetry_names(e){return this.exec("get_all_tlm_names",[e])}get_all_tlm_item_names(e){return this.exec("get_all_tlm_item_names",[e])}async get_tlm_packet(e,s,n,r=30){const i=await this.exec("get_tlm_packet",[e,s],{type:n,stale_time:r});if(i!=null){let o=i.length,a=null;for(let l=0;l<o;l++)a=this.decode_openc3_type(i[l][1]),a!==null&&(i[l][1]=a)}return i}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}async get_tlm_values(e,s=30,n=null){let r={stale_time:s};n!==null&&(r.cache_timeout=n);const i=await this.exec("get_tlm_values",[e],r,{},1e4);let o=i[0].length,a=null;for(let l=0;l<o;l++)a=this.decode_openc3_type(i[0][l]),a!==null&&(i[0][l]=a);return i}get_limits(e,s,n){return this.exec("get_limits",[e,s,n])}async tlm(e,s,n,r="CONVERTED"){let i=null;if(s===void 0)i=await this.exec("tlm",[e]);else if(n===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))i=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else i=await this.exec("tlm",[e,s,n],{type:r});let o=this.decode_openc3_type(i);return o!==null&&(i=o),i}async inject_tlm(e,s,n=null,r="CONVERTED"){await this.exec("inject_tlm",[e,s,n],{type:r})}set_tlm(e,s,n,r){return this.exec("set_tlm",[e,s,n],{type:r})}override_tlm(e,s,n,r){return this.exec("override_tlm",[e,s,n],{type:r})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,s,n,r){return this.exec("normalize_tlm",[e,s,n],{type:r})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.exec("get_all_cmds",[e])}get_all_cmd_names(e,s=!1){return this.exec("get_all_cmd_names",[e],{hidden:s})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,s){return this.exec("get_cmd",[e,s])}get_command(e,s){return this.exec("get_cmd",[e,s])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,s,n,r="CONVERTED"){return this.exec("get_cmd_value",[e,s,n,r])}get_cmd_buffer(e,s){return this.exec("get_cmd_buffer",[e,s])}_cmd(e,s,n,r,i){let o=null;for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&(o=this.encode_openc3_type(r[a]),o!==null&&(r[a]=o));return this.exec(e,[s,n,r],{},i)}get_cmd_hazardous(e,s,n,r={}){return s===void 0?this.exec("get_cmd_hazardous",e,{},r):this._cmd("get_cmd_hazardous",e,s,n,r)}cmd(e,s,n,r={}){return s===void 0?this.exec("cmd",e,{},r):this._cmd("cmd",e,s,n,r)}cmd_no_range_check(e,s,n,r={}){return s===void 0?this.exec("cmd_no_range_check",e,{},r):this._cmd("cmd_no_range_check",e,s,n,r)}cmd_raw(e,s,n,r={}){return s===void 0?this.exec("cmd_raw",e,{},r):this._cmd("cmd_raw",e,s,n,r)}cmd_raw_no_range_check(e,s,n,r={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,{},r):this._cmd("cmd_raw_no_range_check",e,s,n,r)}cmd_no_hazardous_check(e,s,n,r={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,{},r):this._cmd("cmd_no_hazardous_check",e,s,n,r)}cmd_no_checks(e,s,n,r={}){return s===void 0?this.exec("cmd_no_checks",e,{},r):this._cmd("cmd_no_checks",e,s,n,r)}cmd_raw_no_hazardous_check(e,s,n,r={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},r):this._cmd("cmd_raw_no_hazardous_check",e,s,n,r)}cmd_raw_no_checks(e,s,n,r={}){return s===void 0?this.exec("cmd_raw_no_checks",e,{},r):this._cmd("cmd_raw_no_checks",e,s,n,r)}build_cmd(e,s,n){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,n)}build_command(e,s,n){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,n)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,n){return this.exec("save_config",[e,s,n])}delete_config(e,s){return this.exec("delete_config",[e,s])}enable_limits(e,s,n){return this.exec("enable_limits",[e,s,n])}disable_limits(e,s,n){return this.exec("disable_limits",[e,s,n])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(e){return this.exec("get_overall_limits_state",[e])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(e){return this.exec("get_setting",[e])}get_settings(e){return this.exec("get_settings",e)}set_setting(e,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}save_setting(e,s){return this.exec("set_setting",[e,s])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const s=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",s),r=new Uint8Array(n);return Array.from(r).map(i=>i.toString(16).padStart(2,"0")).join("")}}}const yi={components:{ValueWidget:ft,ValuelimitsbarWidget:pt},mixins:[Fe],props:{modelValue:{type:Array,default:()=>[]},timeZone:{type:String,default:"local"}},data(){return{api:null,cable:new ls,ignored:[],ignoredItemsDialog:!1,overallState:"GREEN",currentLimitsSet:"",items:[],itemList:[],screenItems:[],screenValues:{},updateCounter:0,itemsPerPage:25,search:"",headers:[{title:"Timestamp",key:"timestamp",width:"130px",sortable:!0,nowrap:!0},{title:"Item",key:"item",value:t=>t.parameters[2],sortable:!0,minWidth:"100px",width:"200px",maxWidth:"300px"},{title:"Value",key:"value",width:"380px",sortable:!1},{title:"Controls",key:"actions",width:"80px",sortable:!1},{title:"",key:"limits",sortable:!1}],valueLimitsBarWidgetSettings:[["WIDTH","380px"],["0","WIDTH","200px"],["1","WIDTH","180px"]],valueWidgetSettings:[["WIDTH","200px"]]}},computed:{textFieldClass(){return this.overallState?`textfield-${this.overallState.toLowerCase()}`:""},overallStateFormatted(){return this.ignored.length===0?this.overallState:`${this.overallState} (Some items ignored)`},ignoredFormatted(){return this.ignored.map(t=>t.split("__").join(" "))},astroStatus(){switch(this.overallState){case"GREEN":return"normal";case"YELLOW":return"caution";case"RED":return"critical";case"BLUE":return"standby";default:return null}}},created(){this.api=new _s;for(let t of this.modelValue)t.match(/.+__.+__.+/)?this.ignoreItem(t,!0):this.ignorePacket(t,!0);this.updateOutOfLimits(),this.getCurrentLimitsSet(),this.currentSetRefreshInterval=setInterval(this.getCurrentLimitsSet,10*1e3),this.cable.createSubscription("LimitsEventsChannel",window.openc3Scope,{received:t=>{this.cable.recordPing(),this.handleMessages(t)}}).then(t=>{this.limitsSubscription=t}),this.cable.createSubscription("ConfigEventsChannel",window.openc3Scope,{received:t=>{this.cable.recordPing();const e=JSON.parse(t);this.handleConfigEvents(e)}}).then(t=>{this.configSubscription=t})},mounted(){this.updater=setInterval(()=>{this.update()},1e3)},unmounted(){this.updater!=null&&(clearInterval(this.updater),this.updater=null),this.limitsSubscription&&this.limitsSubscription.unsubscribe(),this.configSubscription&&this.configSubscription.unsubscribe(),this.cable.disconnect()},methods:{getCurrentLimitsSet:function(){this.api.get_limits_set().then(t=>{this.currentLimitsSet=t})},updateOutOfLimits(){this.items=[],this.itemList=[],this.api.get_out_of_limits().then(t=>{for(const e of t){let s=e.join("__");if(this.ignored.find(r=>s.includes(r)))continue;this.itemList.push(s);let n={key:e.slice(0,3).join("__"),parameters:e.slice(0,3),timestamp:this.formatDateTime(new Date,this.timeZone)};e[3].includes("YELLOW")&&this.overallState!=="RED"&&(this.overallState="YELLOW"),e[3].includes("RED")&&(this.overallState="RED"),e[3]=="YELLOW"||e[3]=="RED"?n.limits=!1:n.limits=!0,this.items.push(n)}this.calcOverallState()})},calcOverallState(){let t="GREEN";for(let e of this.itemList)if(!this.ignored.find(s=>e.includes(s))&&(e.includes("YELLOW")&&t!=="RED"&&(t="YELLOW"),e.includes("RED"))){t="RED";break}this.overallState=t},ignorePacket(t,e){let[s,n,r]=t.split("__"),i=`${s}__${n}`;for(this.ignored.push(i),e||this.updateIgnored();;){let o=this.itemList.findIndex(a=>a.includes(i));if(o===-1)break;{let a=this.itemList[o].lastIndexOf("__");this.removeItem(this.itemList[o].substring(0,a))}}this.calcOverallState()},ignoreItem(t,e){this.ignored.push(t),e||this.updateIgnored(),this.removeItem(t),this.calcOverallState()},restoreItem(t){this.ignored.splice(t,1),this.updateIgnored(),this.updateOutOfLimits()},removeItem(t){const e=this.itemList.findIndex(s=>s.includes(t));this.items.splice(e,1),this.itemList.splice(e,1)},clearAll(){this.ignored=[],this.updateIgnored(),this.updateOutOfLimits()},updateIgnored(){this.$emit("update:modelValue",this.ignored)},handleConfigEvents(t){for(let e of t)e.kind==="deleted"&&e.type==="target"&&this.updateOutOfLimits()},handleMessages(t){for(let e of t){let s=JSON.parse(e.event);if(s.type!="LIMITS_CHANGE")continue;let n=`${s.target_name}__${s.packet_name}__${s.item_name}`;const r=this.itemList.findIndex(o=>o.includes(n));if(r!==-1){this.itemList[r]=`${n}__${s.new_limits_state}`,this.calcOverallState();continue}if(this.ignored.find(o=>n.includes(o))||s.new_limits_state&&!(s.new_limits_state.includes("YELLOW")||s.new_limits_state.includes("RED")))continue;let i={key:n,timestamp:this.formatNanoseconds(s.time_nsec,this.timeZone),parameters:[s.target_name,s.packet_name,s.item_name]};s.new_limits_state=="YELLOW"||s.new_limits_state=="RED"?i.limits=!1:i.limits=!0,this.itemList.push(`${n}__${s.new_limits_state}`),this.items.push(i),this.calcOverallState()}},update(){this.screenItems.length!==0&&this.api.get_tlm_values(this.screenItems).then(t=>{this.updateValues(t)})},updateValues:function(t){this.updateCounter+=1;for(let e=0;e<t.length;e++)t[e].push(this.updateCounter),this.screenValues[this.screenItems[e]]=t[e]},addItem:function(t){this.screenItems.push(t),this.screenValues[t]=[null,null,0]},deleteItem:function(t){let e=this.screenItems.indexOf(t);this.screenItems.splice(e,1)},showIgnored(){this.ignoredItemsDialog=!0},customFilter(t,e,s){if(!e||e.trim()==="")return!0;if(e=e.toLowerCase(),s.parameters&&s.parameters.length>0){for(const n of s.parameters)if(n.toLowerCase().includes(e))return!0}return!!(s.timestamp&&s.timestamp.toLowerCase().includes(e)||s.key&&s.key.toLowerCase().includes(e))}}},wi=["status"],vi={class:"font-weight-black"};function Si(t,e,s,n,r,i){const o=y("v-text-field"),a=y("v-spacer"),l=y("v-row"),u=y("valuelimitsbar-widget"),d=y("value-widget"),h=y("v-btn"),b=y("v-icon"),f=y("v-list-item-title"),w=y("v-list-item"),p=y("v-list"),A=y("v-menu"),R=y("v-data-table"),E=y("v-card"),O=y("v-toolbar"),V=y("v-divider"),_=y("v-card-text"),j=y("v-card-actions"),T=y("v-dialog");return k(),M("div",null,[g(E,{class:"pa-5"},{default:m(()=>[g(l,{class:"ma-1"},{default:m(()=>[g(o,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Overall Limits State","model-value":i.overallStateFormatted,class:Be(i.textFieldClass),style:{"margin-right":"10px","max-width":"280px"},"data-test":"overall-state"},_e({_:2},[i.astroStatus?{name:"prepend-inner",fn:m(()=>[F("rux-status",{status:i.astroStatus},null,8,wi)]),key:"0"}:void 0]),1032,["model-value","class"]),g(o,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Current Limits Set","model-value":r.currentLimitsSet,style:{"max-width":"200px"},"data-test":"limits-set"},null,8,["model-value"]),g(a),g(o,{modelValue:r.search,"onUpdate:modelValue":e[0]||(e[0]=x=>r.search=x),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",style:{"max-width":"300px"},"data-test":"search"},null,8,["modelValue"])]),_:1}),g(R,{"items-per-page":r.itemsPerPage,"onUpdate:itemsPerPage":e[1]||(e[1]=x=>r.itemsPerPage=x),headers:r.headers,items:r.items,search:r.search,"custom-filter":i.customFilter,"item-value":"key","data-test":"limits-table",class:"limits-table",density:"compact"},{"item.timestamp":m(({item:x})=>[P(J(x.timestamp),1)]),"item.value":m(({item:x})=>[x.limits?(k(),N(u,{key:0,parameters:x.parameters,settings:r.valueLimitsBarWidgetSettings,"screen-values":r.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"])):(k(),N(d,{key:1,parameters:x.parameters,settings:r.valueWidgetSettings,"screen-values":r.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"]))]),"item.actions":m(({item:x})=>[g(A,null,{activator:m(({props:L})=>[g(h,be({icon:"mdi-dots-horizontal",variant:"text",density:"compact","aria-label":"Item Options"},L),null,16)]),default:m(()=>[g(p,null,{default:m(()=>[g(w,{onClick:L=>i.ignorePacket(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[4]||(e[4]=[P("mdi-close-circle-multiple")])),_:1})]),default:m(()=>[g(f,null,{default:m(()=>e[5]||(e[5]=[P("Ignore Entire Packet")])),_:1})]),_:2},1032,["onClick"]),g(w,{onClick:L=>i.ignoreItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[6]||(e[6]=[P("mdi-close-circle")])),_:1})]),default:m(()=>[g(f,null,{default:m(()=>e[7]||(e[7]=[P("Ignore Item")])),_:1})]),_:2},1032,["onClick"]),g(w,{onClick:L=>i.removeItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[8]||(e[8]=[P("mdi-eye-off")])),_:1})]),default:m(()=>[g(f,null,{default:m(()=>e[9]||(e[9]=[P("Temporarily Hide Item")])),_:1})]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),"item.limits":m(({item:x})=>[g(a)]),_:1},8,["items-per-page","headers","items","search","custom-filter"]),e[10]||(e[10]=F("div",{class:"footer"},' Note: Timestamp is "now" for items currently out of limits when the page is loaded. ',-1))]),_:1}),g(T,{modelValue:r.ignoredItemsDialog,"onUpdate:modelValue":e[3]||(e[3]=x=>r.ignoredItemsDialog=x),"max-width":"600"},{default:m(()=>[g(E,null,{default:m(()=>[g(O,{height:"24"},{default:m(()=>[g(a),e[11]||(e[11]=F("span",null,"Ignored Items",-1)),g(a)]),_:1}),g(_,{class:"mt-2"},{default:m(()=>[F("div",null,[(k(!0),M(G,null,ne(i.ignoredFormatted,(x,L)=>(k(),M("div",{key:L},[g(l,{class:"ma-1 align-center"},{default:m(()=>[F("span",vi,J(x),1),g(a),g(h,{icon:"mdi-delete",density:"compact",variant:"text","aria-label":"Remove Ignored Item","data-test":`remove-ignore-${L}`,onClick:Ue=>i.restoreItem(L)},null,8,["data-test","onClick"])]),_:2},1024),L<i.ignoredFormatted.length-1?(k(),N(V,{key:L})):Y("",!0)]))),128))])]),_:1}),g(j,{class:"px-2"},{default:m(()=>[g(h,{variant:"outlined",onClick:i.clearAll},{default:m(()=>e[12]||(e[12]=[P(" Clear All ")])),_:1},8,["onClick"]),g(a),g(h,{variant:"flat",onClick:e[2]||(e[2]=x=>r.ignoredItemsDialog=!1)},{default:m(()=>e[13]||(e[13]=[P(" Ok ")])),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Ei=ge(yi,[["render",Si],["__scopeId","data-v-ed7ec5ac"]]),xi={props:{historyCount:{type:Number,default:1e3},timeZone:{type:String,default:"local"}},mixins:[Fe],data(){return{data:[],cable:new ls,search:"",headers:[{title:"Time",value:"time_nsec",width:250},{title:"Level",value:"level",sortable:!1},{title:"Message",value:"message"}]}},created(){this.cable.createSubscription("LimitsEventsChannel",window.openc3Scope,{received:t=>{this.cable.recordPing(),this.handleMessages(t)}},{historyCount:1e3}).then(t=>{this.limitsSubscription=t})},unmounted(){this.limitsSubscription&&this.limitsSubscription.unsubscribe(),this.cable.disconnect()},methods:{handleMessages(t){for(let e=0;e<t.length;e++){let s=JSON.parse(t[e].event);this.data.unshift(s)}this.data.length>this.historyCount&&(this.data.length=this.historyCount)},getStatus(t){return t.includes("GREEN")?"normal":t.includes("YELLOW")?"caution":t.includes("RED")?"critical":t.includes("BLUE")?"standby":"off"},getColorClass(t){return t.includes("GREEN")?"openc3-green":t.includes("YELLOW")?"openc3-yellow":t.includes("RED")?"openc3-red":t.includes("BLUE")?"openc3-blue":this.$vuetify.theme.dark?"openc3-white":"openc3-black"},calcTableHeight(){return window.innerHeight-250}}},Ci=["status"];function Oi(t,e,s,n,r,i){const o=y("v-spacer"),a=y("v-text-field"),l=y("v-card-title"),u=y("v-data-table"),d=y("v-card");return k(),N(d,{class:"card-height"},{default:m(()=>[g(l,{class:"d-flex align-center"},{default:m(()=>[e[1]||(e[1]=P(" Limits Events ")),g(o),g(a,{modelValue:r.search,"onUpdate:modelValue":e[0]||(e[0]=h=>r.search=h),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),g(u,{headers:r.headers,items:r.data,search:r.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact",height:i.calcTableHeight(),hover:"","data-test":"limits-events"},{"item.time_nsec":m(({item:h})=>[F("span",null,J(t.formatNanoseconds(h.time_nsec,s.timeZone)),1)]),"item.level":m(({item:h})=>[F("rux-status",{status:i.getStatus(h.message)},null,8,Ci)]),"item.message":m(({item:h})=>[F("span",{class:Be(i.getColorClass(h.message))},J(h.message),3)]),_:1},8,["headers","items","search","height"])]),_:1})}const ki={components:{LimitsControl:Ei,LimitsEvents:ge(xi,[["render",Oi],["__scopeId","data-v-210db24e"]]),TopBar:xs,OpenConfigDialog:dt,SaveConfigDialog:ut},mixins:[lt],data(){return{title:"Limits Monitor",configKey:"limits_monitor",api:new _s,timeZone:"local",renderKey:0,ignored:[],openConfig:!1,saveConfig:!1,limitsSets:[],currentLimitsSet:null,currentSetRefreshInterval:null,limitsSetDialog:!1,menus:[{label:"File",items:[{label:"Show Ignored",icon:"mdi-magnify-close",command:()=>{this.$refs.control.showIgnored()}},{label:"Change Limits Set",icon:"mdi-swap-horizontal",command:()=>{this.limitsSetDialog=!0}},{divider:!0},{label:"Open Configuration",icon:"mdi-folder-open",command:()=>{this.openConfig=!0}},{label:"Save Configuration",icon:"mdi-content-save",command:()=>{this.saveConfig=!0}},{label:"Reset Configuration",icon:"mdi-monitor-shimmer",command:()=>{this.ignored=[],this.resetConfigBase(),this.renderKey++}}]}]}},created(){this.api.get_limits_sets().then(t=>{this.limitsSets=t}),this.api.get_setting("time_zone").then(t=>{t&&(this.timeZone=t)}).catch(t=>{})},mounted:function(){if(this.$route.query&&this.$route.query.config)this.openConfiguration(this.$route.query.config,!0);else{let t=this.loadDefaultConfig();JSON.stringify(t)!=="{}"&&(this.ignored=t,this.renderKey++)}},unmounted:function(){clearInterval(this.currentSetRefreshInterval)},methods:{setLimitsSet:function(){this.api.set_limits_set(this.currentLimitsSet),this.limitsSetDialog=!1,this.renderKey++},openConfiguration:function(t,e=!1){this.openConfigBase(t,e,s=>{this.ignored=s,this.renderKey++})},saveConfiguration:function(t){this.saveConfigBase(t,this.ignored)}}};function Ri(t,e,s,n,r,i){const o=y("top-bar"),a=y("limits-control"),l=y("limits-events"),u=y("open-config-dialog"),d=y("save-config-dialog"),h=y("v-spacer"),b=y("v-toolbar"),f=y("v-select"),w=y("v-card-text"),p=y("v-btn"),A=y("v-card-actions"),R=y("v-card"),E=y("v-dialog");return k(),M("div",null,[g(o,{menus:r.menus,title:r.title},null,8,["menus","title"]),(k(),N(a,{ref:"control",key:r.renderKey,modelValue:r.ignored,"onUpdate:modelValue":e[0]||(e[0]=O=>r.ignored=O),"time-zone":r.timeZone},null,8,["modelValue","time-zone"])),e[11]||(e[11]=F("div",{style:{height:"15px"}},null,-1)),g(l,{"time-zone":r.timeZone},null,8,["time-zone"]),r.openConfig?(k(),N(u,{key:0,modelValue:r.openConfig,"onUpdate:modelValue":e[1]||(e[1]=O=>r.openConfig=O),"config-key":r.configKey,onSuccess:i.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):Y("",!0),r.saveConfig?(k(),N(d,{key:1,modelValue:r.saveConfig,"onUpdate:modelValue":e[2]||(e[2]=O=>r.saveConfig=O),"config-key":r.configKey,onSuccess:i.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):Y("",!0),g(E,{modelValue:r.limitsSetDialog,"onUpdate:modelValue":e[5]||(e[5]=O=>r.limitsSetDialog=O),"max-width":"650"},{default:m(()=>[g(R,null,{default:m(()=>[g(b,{height:"24"},{default:m(()=>[g(h),e[6]||(e[6]=F("span",null,"Change Limits Set",-1)),g(h)]),_:1}),g(w,{class:"mt-6"},{default:m(()=>[e[7]||(e[7]=F("span",{style:{display:"block"}}," The Limits Set is a global option which changes the Limits Set across all tools. ",-1)),e[8]||(e[8]=F("span",{style:{display:"block"}}," NOTE: Changing this option clears the current list and recalculates based on the new set. ",-1)),g(f,{modelValue:r.currentLimitsSet,"onUpdate:modelValue":e[3]||(e[3]=O=>r.currentLimitsSet=O),label:"Limits Set",items:r.limitsSets,density:"compact",variant:"outlined","data-test":"limits-set","hide-details":"",class:"mt-3",style:{"max-width":"200px"}},null,8,["modelValue","items"])]),_:1}),g(A,{class:"px-2"},{default:m(()=>[g(h),g(p,{variant:"outlined",onClick:e[4]||(e[4]=O=>r.limitsSetDialog=!1)},{default:m(()=>e[9]||(e[9]=[P(" Cancel ")])),_:1}),g(p,{variant:"flat",onClick:i.setLimitsSet},{default:m(()=>e[10]||(e[10]=[P(" Ok ")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Ji=ws("default",ge(ki,[["render",Ri]]))}}});
|