openc3-cosmos-tool-limitsmonitor 6.9.2 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/tools/limitsmonitor/{ArrayWidget-C59wpWWk-b242f0f78d4ec1e5d916.js → ArrayWidget-DQRQ7dPa-c7a7532297941744579d.js} +2 -2
- data/tools/limitsmonitor/{ArrayplotWidget-tKqIV461-d37184151f18279406ba.js → ArrayplotWidget-BeSfz3MR-c944b9a8b8dff281b6b5.js} +1 -1
- data/tools/limitsmonitor/{BarColumn-CUO9ur6W-2a92f33d779c53d73a6a.js → BarColumn-BdIaQfOz-48f3fb21c2d891c49628.js} +1 -1
- data/tools/limitsmonitor/{BlockWidget-BdlMR_1A-159baf347005d9e1d082.js → BlockWidget-DSFKrUxl-3c9e5ec9b7ed395663e2.js} +2 -2
- data/tools/limitsmonitor/{ButtonWidget-C2JVmh3p-bd7b7cfdf6283dbb53c3.js → ButtonWidget-CFbjdxSr-c62be08330c58c3c8e1d.js} +2 -2
- data/tools/limitsmonitor/{CanvasWidget-BRbdw1fu-de8f830af5867c946ec3.js → CanvasWidget-BloYxuKE-70acb9545b64a9a74209.js} +1 -1
- data/tools/limitsmonitor/{CanvasdotWidget-C8T_w03p-f7dc4a1f2ad8966a609c.js → CanvasdotWidget-CZxUOPRd-c0887d796a5661fca09a.js} +1 -1
- data/tools/limitsmonitor/{CanvasimageWidget-C1w2vSsG-6a7496c95c9b6540acb8.js → CanvasimageWidget-ULQq3nqZ-99c5cd785ba523ab267d.js} +1 -1
- data/tools/limitsmonitor/{CanvasimagevalueWidget-BMv2SmEq-4749ffa99ea069de1426.js → CanvasimagevalueWidget-jFCVXYhi-a655869fe4d69939d029.js} +1 -1
- data/tools/limitsmonitor/{CanvaslabelWidget-LEBZQ3DR-bd7354f08f6fec8c482b.js → CanvaslabelWidget-DQhBI1vZ-f3cf60a6652f8fe32635.js} +1 -1
- data/tools/limitsmonitor/{CanvaslabelvalueWidget-Q6UdEanF-1ab4a75f1d6e65dc2634.js → CanvaslabelvalueWidget-C4REgztL-f94ae9c6c38336c8088b.js} +1 -1
- data/tools/limitsmonitor/{CanvaslineWidget-BhvBCDoS-bf135a22b0d144e45dc0.js → CanvaslineWidget-S4PCEvZM-f36f2144ebd339d2a827.js} +1 -1
- data/tools/limitsmonitor/{CanvaslinevalueWidget-EaASC9TU-d3321309dff413888c19.js → CanvaslinevalueWidget-597khOSA-f23d3e9f061a8890b2b8.js} +1 -1
- data/tools/limitsmonitor/{CheckbuttonWidget-C3bjQwrp-945b7ee7e37ef11a2d25.js → CheckbuttonWidget-BcblKat3-853004fbc7c067c12014.js} +1 -1
- data/tools/limitsmonitor/{ComboboxWidget-CmruSbJy-aa876dbaa4cd2713adef.js → ComboboxWidget-BMcHS4g5-e752dc661756a80771ad.js} +1 -1
- data/tools/limitsmonitor/{DateWidget-CcUxRlJ2-551dfa276b7100cac01d.js → DateWidget-BpnMzSBn-300e6522caa8eaa1578e.js} +1 -1
- data/tools/limitsmonitor/DetailsDialog-q9piPmHq-bb2b796e2da46cf35b0d.js +1 -0
- data/tools/limitsmonitor/{DynamicWidget-DHL7pbgW-ee761caa2a55b85b903b.js → DynamicWidget-DHL7pbgW-9a637f6edf8688c6c2a2.js} +1 -1
- data/tools/limitsmonitor/{FormatvalueWidget-Lk5K0wTL-25ca230adab91ed8beee.js → FormatvalueWidget-Cm-HmAmw-7104ae2a176e427dd12e.js} +1 -1
- data/tools/limitsmonitor/Graph-BEodMaxQ-2092dec387719d7b5139.js +1 -0
- data/tools/limitsmonitor/{GraphWidget-BaO2FpKo-b5a2a10503add77bc662.js → GraphWidget-CAADBFV--b95d88058875cc9208a8.js} +1 -1
- data/tools/limitsmonitor/{HorizontalWidget-D3Q5IUQg-ca50ad1fc1eba2d84aa0.js → HorizontalWidget-NcXIXxh7-5c44263acfe63b3c25a5.js} +1 -1
- data/tools/limitsmonitor/HorizontalboxWidget-CW9XX4uH-87207d4fff2f3d9f1e3a.js +1 -0
- data/tools/limitsmonitor/{HorizontallineWidget-DZcIetQh-cfe5249f067ca2a0070a.js → HorizontallineWidget-Cu2dDt7k-f2fd5c961066efa218ee.js} +1 -1
- data/tools/limitsmonitor/{IframeWidget-Df7vTYZj-b77db89efea318b00264.js → IframeWidget-BBU3MkSq-af9b2f9227ca5654ccdf.js} +1 -1
- data/tools/limitsmonitor/{ImageLoader-DpKY46fX-5f2add87894c3e0df226.js → ImageLoader-XAGgjKkq-6128dee2d16478103fd1.js} +1 -1
- data/tools/limitsmonitor/{ImageviewerWidget-wHbhv08x-36824de9751f6bbf7cb1.js → ImageviewerWidget-UByjeO63-2447583ff07130d102bf.js} +1 -1
- data/tools/limitsmonitor/{LabelWidget-BehwzOCR-3a4aefd5239727fde942.js → LabelWidget-BsOpolUL-3eb09fc23df0013319f1.js} +1 -1
- data/tools/limitsmonitor/{LabelledWidget-DJKR8ikj-69f4315a44b51c3934d1.js → LabelledWidget-DVOGpgZ--463e1bf41e7263b01c8e.js} +1 -1
- data/tools/limitsmonitor/LabelprogressbarWidget-BeE9fDs6-e5bec7dbb9f611e2e44d.js +1 -0
- data/tools/limitsmonitor/LabelsparklineWidget-Bj7trKML-32528e1e03bb7608b92e.js +1 -0
- data/tools/limitsmonitor/LabelvalueWidget-Dwqsh5o2-958b26a2b4cdf4c7bf6c.js +1 -0
- data/tools/limitsmonitor/{LabelvaluedescWidget-DgNX7tK2-3e7e18cc547980003cc9.js → LabelvaluedescWidget-Cfu2vuja-1645e2ad78d2b498325f.js} +1 -1
- data/tools/limitsmonitor/LabelvaluelimitsbarWidget-DYV68AJ_-ca9d9fc270ee3058ac78.js +1 -0
- data/tools/limitsmonitor/LabelvaluelimitscolumnWidget-CtaoTixt-c67903a045c798b91e80.js +1 -0
- data/tools/limitsmonitor/{LabelvaluerangebarWidget-CQ0xCUFU-9036bf0737f64ab1a95a.js → LabelvaluerangebarWidget-3EaUB6E6-acfa82c367f43faa8c44.js} +1 -1
- data/tools/limitsmonitor/{Layout-CrCMUbtG-db0ee1c21c4515add7f4.js → Layout-DNR3xnku-5314828d9e78fc4b40c8.js} +1 -1
- data/tools/limitsmonitor/{LedWidget-DzQNEDF7-9bfcb4415664b1f99f9b.js → LedWidget-Gi6GXtrW-584ea1db5a5b44e21b79.js} +1 -1
- data/tools/limitsmonitor/LimitsMonitor-81402ab26c3eb7469ddf.js +8 -0
- data/tools/limitsmonitor/{LimitsbarWidget-zkoAz9SQ-bf349bef4733df6453c7.js → LimitsbarWidget-BTZQY9XQ-887f18afcd44aede9233.js} +1 -1
- data/tools/limitsmonitor/{LimitscolorWidget-dez316Rk-fa325823b203b17021e5.js → LimitscolorWidget-CFnmvlrA-8b3196ea3f44ec29a470.js} +1 -1
- data/tools/limitsmonitor/{LimitscolumnWidget-D-IPNDVg-1dff9d2c7748edbd62fd.js → LimitscolumnWidget-DSsz36tT-61c54c580f42c5757636.js} +1 -1
- data/tools/limitsmonitor/{LinegraphWidget-CicnZgjt-af8aef15fb574454bf2c.js → LinegraphWidget-CeBijgDo-4f770ef9479c7b5e3990.js} +1 -1
- data/tools/limitsmonitor/{MatrixbycolumnsWidget-D3qN6GTr-b90e9f87eb5fec623eab.js → MatrixbycolumnsWidget-DX9uhjAv-223dcb4fa13b30e8dc27.js} +1 -1
- data/tools/limitsmonitor/{ProgressbarWidget-CLilcPBe-b9c50749a2d3ee67b75d.js → ProgressbarWidget-DJepvOip-78666f10bf80afbfb7c3.js} +1 -1
- data/tools/limitsmonitor/{RadiobuttonWidget-Dsy01RJ--855ed1a9b04cb42732ab.js → RadiobuttonWidget-4e8ROIfg-fe7d723ee73a5bf6bd06.js} +1 -1
- data/tools/limitsmonitor/RadiogroupWidget-CUucj6aT-27cf7805d23d5d1d1706.js +1 -0
- data/tools/limitsmonitor/{RangebarWidget-DhcoIdNf-46c8d3c7639f05cc63f4.js → RangebarWidget-Bu4rqlrx-1d3909dc08a45caec8a3.js} +1 -1
- data/tools/limitsmonitor/{RollupWidget-BypuPvE7-9805478a8113da1c32fc.js → RollupWidget-ByLvEEau-c94785ef173dfc8da208.js} +1 -1
- data/tools/limitsmonitor/{ScrollwindowWidget-DNQgHoNO-92cd9d075d77f49d7a4a.js → ScrollwindowWidget-CXJ9QGN1-b598cf34079889eea57f.js} +1 -1
- data/tools/limitsmonitor/{SignalWidget-BHwyScCG-62356b37e5f3bd598be2.js → SignalWidget-qvL2YZJA-935495d803fa69d5d78e.js} +1 -1
- data/tools/limitsmonitor/{SpacerWidget-CFxXXTm7-45b8665f69c3d505e350.js → SpacerWidget-CaWx41K7-bbf2c7b2a7733320f99b.js} +1 -1
- data/tools/limitsmonitor/{SparklineWidget-C0lRpRrp-bae763739e23346a0ef4.js → SparklineWidget-BkNSRypJ-a346bac164f770964729.js} +1 -1
- data/tools/limitsmonitor/TabbookWidget-MsrRG1vn-51498984f018e651756d.js +1 -0
- data/tools/limitsmonitor/{TextboxWidget-DoA2b3YU-34a47a86aa0deb41c5b7.js → TextboxWidget-DbwpPVGB-76a8bf61327112842a33.js} +1 -1
- data/tools/limitsmonitor/{TextfieldWidget-Dj4DV74o-45dd7f64e78433cea9b6.js → TextfieldWidget-DzMlTMYW-8137530e6c4f809bdd48.js} +1 -1
- data/tools/limitsmonitor/{TimeWidget-DAQDQ0UM-1980b7e09a57f6604c2a.js → TimeWidget-BHybAfg8-329352d52cc0a62babea.js} +1 -1
- data/tools/limitsmonitor/{TitleWidget-Ct0JlY9s-deb44828ad2996964646.js → TitleWidget-DL_sE5YE-b184f3d107d589c754aa.js} +1 -1
- data/tools/limitsmonitor/VWidget-D06LY-Yc-ebd4169882dd0a6ed58d.js +1 -0
- data/tools/limitsmonitor/{ValueWidget-QaBYsiZz-6c282d12a740afb69483.js → ValueWidget-CGT0LV_n-61e108655b7e15bfd2e4.js} +1 -1
- data/tools/limitsmonitor/{ValuelimitsbarWidget-CFToRM7w-868395918b60f02bedf0.js → ValuelimitsbarWidget-CmpyPO-1-b491db90eae3d5a518ea.js} +1 -1
- data/tools/limitsmonitor/ValuelimitscolumnWidget-jzxrQd-f-82e3de73000d49277fad.js +1 -0
- data/tools/limitsmonitor/{ValuerangebarWidget-CChK2Lmm-1131f107a0f2e7cdbb8e.js → ValuerangebarWidget-C8ckuAeh-8ed320172527314d8ee6.js} +1 -1
- data/tools/limitsmonitor/{VerticalWidget-C8iN5DJK-6dcf0704901b6ba19dd3.js → VerticalWidget-qN82km_m-761b0ae3a4f5ae5df2be.js} +1 -1
- data/tools/limitsmonitor/VerticalboxWidget-CiJZDlHJ-7be3e82cbf0b146913c1.js +1 -0
- data/tools/limitsmonitor/{Widget-Cx1jBJHK-ced10deedfc13f34afdc.js → Widget-DXvVFSH5-6b6b120cb8369fca6958.js} +1 -1
- data/tools/limitsmonitor/{main-aa2b3090dbae2d05f657.js → main-11ad5b3ddd59fe0fb743.js} +54 -54
- data/tools/limitsmonitor/main.js +1 -1
- metadata +68 -68
- data/tools/limitsmonitor/DetailsDialog-DxYZre4A-18843fd5daf1ed05e2e7.js +0 -1
- data/tools/limitsmonitor/Graph-CjEE2WxX-aed1d272d8422a7f0cc1.js +0 -1
- data/tools/limitsmonitor/HorizontalboxWidget-D7bUUqfG-34470232acb431141b51.js +0 -1
- data/tools/limitsmonitor/LabelprogressbarWidget-D4Qzq894-b711ed1c73c23e349ea1.js +0 -1
- data/tools/limitsmonitor/LabelsparklineWidget-CwCOklZG-bac7fe4631d0c0f60580.js +0 -1
- data/tools/limitsmonitor/LabelvalueWidget-DW8Q7BTX-9ddba17783c123476561.js +0 -1
- data/tools/limitsmonitor/LabelvaluelimitsbarWidget-DAEBW0hU-8621e81acfd6ce993477.js +0 -1
- data/tools/limitsmonitor/LabelvaluelimitscolumnWidget-Dok-of6n-51b5831f261b688cdbf7.js +0 -1
- data/tools/limitsmonitor/LimitsMonitor-5b3d35f7fef478749bef.js +0 -8
- data/tools/limitsmonitor/RadiogroupWidget-BNcVGNj1-4134b7d1337d9e493309.js +0 -1
- data/tools/limitsmonitor/TabbookWidget-CeeBOYOt-b601700ef04d1dc9c967.js +0 -1
- data/tools/limitsmonitor/VWidget-A802LGvR-1f0bc51907a47fd7869f.js +0 -1
- data/tools/limitsmonitor/ValuelimitscolumnWidget-BG7naMYx-218a517b80d4245e4008.js +0 -1
- data/tools/limitsmonitor/VerticalboxWidget-CXwUSWrP-bb5783c9aa58ac881040.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
System.register(["./main-aa2b3090dbae2d05f657.js","vue","single-spa","./ValueWidget-QaBYsiZz-6c282d12a740afb69483.js","./IframeWidget-Df7vTYZj-b77db89efea318b00264.js","./ValuelimitsbarWidget-CFToRM7w-868395918b60f02bedf0.js","vue-router","vuex","vuetify","./DetailsDialog-DxYZre4A-18843fd5daf1ed05e2e7.js","./VWidget-A802LGvR-1f0bc51907a47fd7869f.js","./Widget-Cx1jBJHK-ced10deedfc13f34afdc.js","./LimitsbarWidget-zkoAz9SQ-bf349bef4733df6453c7.js","./BarColumn-CUO9ur6W-2a92f33d779c53d73a6a.js"],function(Is,Ni){"use strict";var ft,xe,ze,pt,mt,gt,y,P,k,bt,b,g,B,G,H,se,ue,U,Ce,Oe,re,We,He,_t,yt,wt;return{setters:[x=>{ft=x.d,xe=x._,ze=x.R,pt=x.p,mt=x.a,gt=x.g},x=>{y=x.resolveComponent,P=x.createBlock,k=x.openBlock,bt=x.Teleport,b=x.createVNode,g=x.withCtx,B=x.createElementVNode,G=x.toDisplayString,H=x.createElementBlock,se=x.Fragment,ue=x.renderList,U=x.createTextVNode,Ce=x.mergeProps,Oe=x.createSlots,re=x.createCommentVNode,We=x.normalizeStyle,He=x.normalizeClass,_t=x.withKeys},null,x=>{yt=x.default},null,x=>{wt=x.default},null,null,null,null,null,null,null,null],execute:function(){var x=document.createElement("style");x.textContent=`.footer[data-v-71a2dc86]{padding-top:5px}.v-input[data-v-71a2dc86]{background-color:var(--color-background-base-default)}.textfield-green[data-v-71a2dc86]{color:#00c800}.textfield-yellow[data-v-71a2dc86]{color:#ffdc00}.textfield-red[data-v-71a2dc86]{color:#ff2d2d}.limits-table[data-v-71a2dc86]{margin-top:5px;margin-bottom:10px}.limits-table[data-v-71a2dc86] th{font-weight:700;background-color:var(--color-background-base-default)}.card-height[data-v-3c276116]{height:calc(100vh - 150px)}
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(x);const As={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}},Ts={class:"app-title mr-2"};function Ls(t,e,s,r,n,o){const i=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"),_=y("v-list-item"),f=y("v-list"),m=y("v-menu"),p=y("v-radio"),R=y("v-list-item-action"),A=y("v-radio-group"),C=y("v-checkbox");return k(),P(bt,{to:"#openc3-menu"},[b(a,{"no-gutters":""},{default:g(()=>[b(i,{"align-self":"end"},{default:g(()=>[B("span",Ts,G(s.title),1)]),_:1})]),_:1}),b(a,{dense:"",class:"flex-nowrap"},{default:g(()=>[(k(!0),H(se,null,ue(s.menus,(E,F)=>(k(),P(m,{ref_for:!0,ref:"topmenu",key:F},{activator:g(({props:w})=>[b(u,Ce({ref_for:!0},w,{variant:"outlined",class:"mx-1 menu-button",text:E.label,"data-test":o.formatDT(`${s.title} ${E.label}`)}),{append:g(()=>[b(l,{class:"menu-button-icon"},{default:g(()=>[...e[0]||(e[0]=[U(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:g(()=>[b(f,null,{default:g(()=>[(k(!0),H(se,null,ue(E.items,(w,$)=>(k(),H(se,null,[w.divider?(k(),P(d,{key:$+"-divider"})):w.subMenu&&w.subMenu.length>0?(k(),H("div",{key:$+"-submenu"},[(k(),P(m,{"open-on-hover":"",location:"right",key:$},{activator:g(({props:T})=>[(k(),P(_,Ce({ref_for:!0},T,{disabled:w.disabled,key:$}),Oe({append:g(()=>[b(l,null,{default:g(()=>[...e[1]||(e[1]=[U(" mdi-chevron-right ",-1)])]),_:1})]),default:g(()=>[!w.radio&&!w.checkbox?(k(),P(h,{key:0,style:We("cursor: pointer;"+(w.disabled?"opacity: 0.2":""))},{default:g(()=>[U(G(w.label),1)]),_:2},1032,["style"])):re("",!0)]),_:2},[w.icon?{name:"prepend",fn:g(()=>[b(l,{disabled:w.disabled},{default:g(()=>[U(G(w.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:g(()=>[b(f,null,{default:g(()=>[(k(!0),H(se,null,ue(w.subMenu,(T,O)=>(k(),P(_,{key:O,"prepend-icon":T.icon,onClick:L=>o.subMenuClick(T)},{default:g(()=>[b(h,null,{default:g(()=>[U(G(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):w.radioGroup?(k(),P(A,{"model-value":w.value,"onUpdate:modelValue":w.command,key:$+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:g(()=>[(k(!0),H(se,null,ue(w.choices,(T,O)=>(k(),P(_,{key:O+"-choice"},{default:g(()=>[b(R,{class:"list-action"},{default:g(()=>[b(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(),P(_,{onClick:T=>w.command(w),disabled:w.disabled,"data-test":o.formatDT(`${s.title} ${E.label} ${w.label}`),key:$+"-list"},Oe({default:g(()=>[w.checkbox?(k(),P(R,{key:0,class:"list-action"},{default:g(()=>[b(C,{modelValue:w.checked,"onUpdate:modelValue":T=>w.checked=T,label:w.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):re("",!0),!w.radio&&!w.checkbox?(k(),P(h,{key:1,style:We("cursor: pointer;"+(w.disabled?"opacity: 0.2":""))},{default:g(()=>[U(G(w.label),1)]),_:2},1032,["style"])):re("",!0)]),_:2},[w.icon?{name:"prepend",fn:g(()=>[b(l,{icon:w.icon,disabled:w.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const js=ft(As,[["render",Ls],["__scopeId","data-v-4d454b93"]]);var Ns=Object.defineProperty,Ps=(t,e,s)=>e in t?Ns(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,ke=(t,e,s)=>Ps(t,typeof e!="symbol"?e+"":e,s);function vt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Us}=Object.prototype,{getPrototypeOf:Je}=Object,{iterator:Re,toStringTag:St}=Symbol,Ie=(t=>e=>{const s=Us.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),J=t=>(t=t.toLowerCase(),e=>Ie(e)===t),Ae=t=>e=>typeof e===t,{isArray:de}=Array,he=Ae("undefined");function me(t){return t!==null&&!he(t)&&t.constructor!==null&&!he(t.constructor)&&V(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Et=J("ArrayBuffer");function Fs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Et(t.buffer),e}const Ds=Ae("string"),V=Ae("function"),xt=Ae("number"),ge=t=>t!==null&&typeof t=="object",$s=t=>t===!0||t===!1,Te=t=>{if(Ie(t)!=="object")return!1;const e=Je(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(St in t)&&!(Re in t)},Bs=t=>{if(!ge(t)||me(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Vs=J("Date"),qs=J("File"),Ms=J("Blob"),zs=J("FileList"),Ws=t=>ge(t)&&V(t.pipe),Hs=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||V(t.append)&&((e=Ie(t))==="formdata"||e==="object"&&V(t.toString)&&t.toString()==="[object FormData]"))},Js=J("URLSearchParams"),[Ks,Zs,Ys,Gs]=["ReadableStream","Request","Response","Headers"].map(J),Xs=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function be(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let r,n;if(typeof t!="object"&&(t=[t]),de(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{if(me(t))return;const o=s?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(r=0;r<i;r++)a=o[r],e.call(null,t[a],a,t)}}function Ct(t,e){if(me(t))return null;e=e.toLowerCase();const s=Object.keys(t);let r=s.length,n;for(;r-- >0;)if(n=s[r],e===n.toLowerCase())return n;return null}const ne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ot=t=>!he(t)&&t!==ne;function Ke(){const{caseless:t,skipUndefined:e}=Ot(this)&&this||{},s={},r=(n,o)=>{const i=t&&Ct(s,o)||o;Te(s[i])&&Te(n)?s[i]=Ke(s[i],n):Te(n)?s[i]=Ke({},n):de(n)?s[i]=n.slice():(!e||!he(n))&&(s[i]=n)};for(let n=0,o=arguments.length;n<o;n++)arguments[n]&&be(arguments[n],r);return s}const Qs=(t,e,s,{allOwnKeys:r}={})=>(be(e,(n,o)=>{s&&V(n)?t[o]=vt(n,s):t[o]=n},{allOwnKeys:r}),t),er=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),tr=(t,e,s,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},sr=(t,e,s,r)=>{let n,o,i;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),o=n.length;o-- >0;)i=n[o],(!r||r(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=s!==!1&&Je(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},rr=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const r=t.indexOf(e,s);return r!==-1&&r===s},nr=t=>{if(!t)return null;if(de(t))return t;let e=t.length;if(!xt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},ir=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Je(Uint8Array)),or=(t,e)=>{const s=(t&&t[Re]).call(t);let r;for(;(r=s.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},ar=(t,e)=>{let s;const r=[];for(;(s=t.exec(e))!==null;)r.push(s);return r},cr=J("HTMLFormElement"),lr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,r){return s.toUpperCase()+r}),kt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),ur=J("RegExp"),Rt=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),r={};be(s,(n,o)=>{let i;(i=e(n,o,t))!==!1&&(r[o]=i||n)}),Object.defineProperties(t,r)},dr=t=>{Rt(t,(e,s)=>{if(V(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const r=t[s];if(V(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},hr=(t,e)=>{const s={},r=n=>{n.forEach(o=>{s[o]=!0})};return de(t)?r(t):r(String(t).split(e)),s},fr=()=>{},pr=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function mr(t){return!!(t&&V(t.append)&&t[St]==="FormData"&&t[Re])}const gr=t=>{const e=new Array(10),s=(r,n)=>{if(ge(r)){if(e.indexOf(r)>=0)return;if(me(r))return r;if(!("toJSON"in r)){e[n]=r;const o=de(r)?[]:{};return be(r,(i,a)=>{const l=s(i,n+1);!he(l)&&(o[a]=l)}),e[n]=void 0,o}}return r};return s(t,0)},br=J("AsyncFunction"),_r=t=>t&&(ge(t)||V(t))&&V(t.then)&&V(t.catch),It=((t,e)=>t?setImmediate:e?((s,r)=>(ne.addEventListener("message",({source:n,data:o})=>{n===ne&&o===s&&r.length&&r.shift()()},!1),n=>{r.push(n),ne.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",V(ne.postMessage)),yr=typeof queueMicrotask<"u"?queueMicrotask.bind(ne):typeof process<"u"&&process.nextTick||It,wr=t=>t!=null&&V(t[Re]),c={isArray:de,isArrayBuffer:Et,isBuffer:me,isFormData:Hs,isArrayBufferView:Fs,isString:Ds,isNumber:xt,isBoolean:$s,isObject:ge,isPlainObject:Te,isEmptyObject:Bs,isReadableStream:Ks,isRequest:Zs,isResponse:Ys,isHeaders:Gs,isUndefined:he,isDate:Vs,isFile:qs,isBlob:Ms,isRegExp:ur,isFunction:V,isStream:Ws,isURLSearchParams:Js,isTypedArray:ir,isFileList:zs,forEach:be,merge:Ke,extend:Qs,trim:Xs,stripBOM:er,inherits:tr,toFlatObject:sr,kindOf:Ie,kindOfTest:J,endsWith:rr,toArray:nr,forEachEntry:or,matchAll:ar,isHTMLForm:cr,hasOwnProperty:kt,hasOwnProp:kt,reduceDescriptors:Rt,freezeMethods:dr,toObjectSet:hr,toCamelCase:lr,noop:fr,toFiniteNumber:pr,findKey:Ct,global:ne,isContextDefined:Ot,isSpecCompliantForm:mr,toJSONObject:gr,isAsyncFn:br,isThenable:_r,setImmediate:It,asap:yr,isIterable:wr};function S(t,e,s,r,n){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),r&&(this.request=r),n&&(this.response=n,this.status=n.status?n.status:null)}c.inherits(S,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 At=S.prototype,Tt={};["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=>{Tt[t]={value:t}}),Object.defineProperties(S,Tt),Object.defineProperty(At,"isAxiosError",{value:!0}),S.from=(t,e,s,r,n,o)=>{const i=Object.create(At);c.toFlatObject(t,i,function(u){return u!==Error.prototype},u=>u!=="isAxiosError");const a=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return S.call(i,a,l,s,r,n),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",o&&Object.assign(i,o),i};const vr=null;function Ze(t){return c.isPlainObject(t)||c.isArray(t)}function Lt(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function jt(t,e,s){return t?t.concat(e).map(function(r,n){return r=Lt(r),!s&&n?"["+r+"]":r}).join(s?".":""):e}function Sr(t){return c.isArray(t)&&!t.some(Ze)}const Er=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Le(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,m){return!c.isUndefined(m[f])});const r=s.metaTokens,n=s.visitor||u,o=s.dots,i=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(n))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!a&&c.isBlob(f))throw new S("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,m,p){let R=f;if(f&&!p&&typeof f=="object"){if(c.endsWith(m,"{}"))m=r?m:m.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&Sr(f)||(c.isFileList(f)||c.endsWith(m,"[]"))&&(R=c.toArray(f)))return m=Lt(m),R.forEach(function(A,C){!(c.isUndefined(A)||A===null)&&e.append(i===!0?jt([m],C,o):i===null?m:m+"[]",l(A))}),!1}return Ze(f)?!0:(e.append(jt(p,m,o),l(f)),!1)}const d=[],h=Object.assign(Er,{defaultVisitor:u,convertValue:l,isVisitable:Ze});function _(f,m){if(!c.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(f),c.forEach(f,function(p,R){(!(c.isUndefined(p)||p===null)&&n.call(e,p,c.isString(R)?R.trim():R,m,h))===!0&&_(p,m?m.concat(R):[R])}),d.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return _(t),e}function Nt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ye(t,e){this._pairs=[],t&&Le(t,this,e)}const Pt=Ye.prototype;Pt.append=function(t,e){this._pairs.push([t,e])},Pt.toString=function(t){const e=t?function(s){return t.call(this,s,Nt)}:Nt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function xr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ut(t,e,s){if(!e)return t;const r=s&&s.encode||xr;c.isFunction(s)&&(s={serialize:s});const n=s&&s.serialize;let o;if(n?o=n(e,s):o=c.isURLSearchParams(e)?e.toString():new Ye(e,s).toString(r),o){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Ft{constructor(){this.handlers=[]}use(e,s,r){return this.handlers.push({fulfilled:e,rejected:s,synchronous:r?r.synchronous:!1,runWhen:r?r.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 Dt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cr=typeof URLSearchParams<"u"?URLSearchParams:Ye,Or=typeof FormData<"u"?FormData:null,kr=typeof Blob<"u"?Blob:null,Rr={isBrowser:!0,classes:{URLSearchParams:Cr,FormData:Or,Blob:kr},protocols:["http","https","file","blob","url","data"]},Ge=typeof window<"u"&&typeof document<"u",Xe=typeof navigator=="object"&&navigator||void 0,Ir=Ge&&(!Xe||["ReactNative","NativeScript","NS"].indexOf(Xe.product)<0),Ar=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Tr=Ge&&window.location.href||"http://localhost",Lr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ge,hasStandardBrowserEnv:Ir,hasStandardBrowserWebWorkerEnv:Ar,navigator:Xe,origin:Tr},Symbol.toStringTag,{value:"Module"})),D={...Lr,...Rr};function jr(t,e){return Le(t,new D.classes.URLSearchParams,{visitor:function(s,r,n,o){return D.isNode&&c.isBuffer(s)?(this.append(r,s.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Nr(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Pr(t){const e={},s=Object.keys(t);let r;const n=s.length;let o;for(r=0;r<n;r++)o=s[r],e[o]=t[o];return e}function $t(t){function e(s,r,n,o){let i=s[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=o>=s.length;return i=!i&&c.isArray(n)?n.length:i,l?(c.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):((!n[i]||!c.isObject(n[i]))&&(n[i]=[]),e(s,r,n[i],o)&&c.isArray(n[i])&&(n[i]=Pr(n[i])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const s={};return c.forEachEntry(t,(r,n)=>{e(Nr(r),n,s,0)}),s}return null}function Ur(t,e,s){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(s||JSON.stringify)(t)}const _e={transitional:Dt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",r=s.indexOf("application/json")>-1,n=c.isObject(t);if(n&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return r?JSON.stringify($t(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 o;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return jr(t,this.formSerializer).toString();if((o=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const i=this.env&&this.env.FormData;return Le(o?{"files[]":t}:t,i&&new i,this.formSerializer)}}return n||r?(e.setContentType("application/json",!1),Ur(t)):t}],transformResponse:[function(t){const e=this.transitional||_e.transitional,s=e&&e.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(s&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(o){if(n)throw o.name==="SyntaxError"?S.from(o,S.ERR_BAD_RESPONSE,this,null,this.response):o}}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=>{_e.headers[t]={}});const Fr=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"]),Dr=t=>{const e={};let s,r,n;return t&&t.split(`
|
|
3
|
-
`).forEach(function(o){n=o.indexOf(":"),s=o.substring(0,n).trim().toLowerCase(),r=o.substring(n+1).trim(),!(!s||e[s]&&Fr[s])&&(s==="set-cookie"?e[s]?e[s].push(r):e[s]=[r]:e[s]=e[s]?e[s]+", "+r:r)}),e},Bt=Symbol("internals");function ye(t){return t&&String(t).trim().toLowerCase()}function je(t){return t===!1||t==null?t:c.isArray(t)?t.map(je):String(t)}function $r(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=s.exec(t);)e[r[1]]=r[2];return e}const Br=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Qe(t,e,s,r,n){if(c.isFunction(r))return r.call(this,e,s);if(n&&(e=s),!!c.isString(e)){if(c.isString(r))return e.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(e)}}function Vr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,r)=>s.toUpperCase()+r)}function qr(t,e){const s=c.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+s,{value:function(n,o,i){return this[r].call(this,e,n,o,i)},configurable:!0})})}let q=class{constructor(t){t&&this.set(t)}set(t,e,s){const r=this;function n(i,a,l){const u=ye(a);if(!u)throw new Error("header name must be a non-empty string");const d=c.findKey(r,u);(!d||r[d]===void 0||l===!0||l===void 0&&r[d]!==!1)&&(r[d||a]=je(i))}const o=(i,a)=>c.forEach(i,(l,u)=>n(l,u,a));if(c.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(c.isString(t)&&(t=t.trim())&&!Br(t))o(Dr(t),e);else if(c.isObject(t)&&c.isIterable(t)){let i={},a,l;for(const u of t){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");i[l=u[0]]=(a=i[l])?c.isArray(a)?[...a,u[1]]:[a,u[1]]:u[1]}o(i,e)}else t!=null&&n(e,t,s);return this}get(t,e){if(t=ye(t),t){const s=c.findKey(this,t);if(s){const r=this[s];if(!e)return r;if(e===!0)return $r(r);if(c.isFunction(e))return e.call(this,r,s);if(c.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ye(t),t){const s=c.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Qe(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let r=!1;function n(o){if(o=ye(o),o){const i=c.findKey(s,o);i&&(!e||Qe(s,s[i],i,e))&&(delete s[i],r=!0)}}return c.isArray(t)?t.forEach(n):n(t),r}clear(t){const e=Object.keys(this);let s=e.length,r=!1;for(;s--;){const n=e[s];(!t||Qe(this,this[n],n,t,!0))&&(delete this[n],r=!0)}return r}normalize(t){const e=this,s={};return c.forEach(this,(r,n)=>{const o=c.findKey(s,n);if(o){e[o]=je(r),delete e[n];return}const i=t?Vr(n):String(n).trim();i!==n&&delete e[n],e[i]=je(r),s[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return c.forEach(this,(s,r)=>{s!=null&&s!==!1&&(e[r]=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(r=>s.set(r)),s}static accessor(t){const e=(this[Bt]=this[Bt]={accessors:{}}).accessors,s=this.prototype;function r(n){const o=ye(n);e[o]||(qr(s,n),e[o]=!0)}return c.isArray(t)?t.forEach(r):r(t),this}};q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(q.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[s]=r}}}),c.freezeMethods(q);function et(t,e){const s=this||_e,r=e||s,n=q.from(r.headers);let o=r.data;return c.forEach(t,function(i){o=i.call(s,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Vt(t){return!!(t&&t.__CANCEL__)}function fe(t,e,s){S.call(this,t??"canceled",S.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(fe,S,{__CANCEL__:!0});function qt(t,e,s){const r=s.config.validateStatus;!s.status||!r||r(s.status)?t(s):e(new S("Request failed with status code "+s.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Mr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function zr(t,e){t=t||10;const s=new Array(t),r=new Array(t);let n=0,o=0,i;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),u=r[o];i||(i=l),s[n]=a,r[n]=l;let d=o,h=0;for(;d!==n;)h+=s[d++],d=d%t;if(n=(n+1)%t,n===o&&(o=(o+1)%t),l-i<e)return;const _=u&&l-u;return _?Math.round(h*1e3/_):void 0}}function Wr(t,e){let s=0,r=1e3/e,n,o;const i=(a,l=Date.now())=>{s=l,n=null,o&&(clearTimeout(o),o=null),t(...a)};return[(...a)=>{const l=Date.now(),u=l-s;u>=r?i(a,l):(n=a,o||(o=setTimeout(()=>{o=null,i(n)},r-u)))},()=>n&&i(n)]}const Ne=(t,e,s=3)=>{let r=0;const n=zr(50,250);return Wr(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-r,u=n(l),d=i<=a;r=i;const h={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-i)/u:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},s)},Mt=(t,e)=>{const s=t!=null;return[r=>e[0]({lengthComputable:s,total:t,loaded:r}),e[1]]},zt=t=>(...e)=>c.asap(()=>t(...e)),Hr=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,Jr=D.hasStandardBrowserEnv?{write(t,e,s,r,n,o,i){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];c.isNumber(s)&&a.push(`expires=${new Date(s).toUTCString()}`),c.isString(r)&&a.push(`path=${r}`),c.isString(n)&&a.push(`domain=${n}`),o===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Kr(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Wt(t,e,s){let r=!Kr(e);return t&&(r||s==!1)?Zr(t,e):e}const Ht=t=>t instanceof q?{...t}:t;function ie(t,e){e=e||{};const s={};function r(u,d,h,_){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:_},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function n(u,d,h,_){if(c.isUndefined(d)){if(!c.isUndefined(u))return r(void 0,u,h,_)}else return r(u,d,h,_)}function o(u,d){if(!c.isUndefined(d))return r(void 0,d)}function i(u,d){if(c.isUndefined(d)){if(!c.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function a(u,d,h){if(h in e)return r(u,d);if(h in t)return r(void 0,u)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,d,h)=>n(Ht(u),Ht(d),h,!0)};return c.forEach(Object.keys({...t,...e}),function(u){const d=l[u]||n,h=d(t[u],e[u],u);c.isUndefined(h)&&d!==a||(s[u]=h)}),s}const Jt=t=>{const e=ie({},t);let{data:s,withXSRFToken:r,xsrfHeaderName:n,xsrfCookieName:o,headers:i,auth:a}=e;if(e.headers=i=q.from(i),e.url=Ut(Wt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(s)){if(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(s.getHeaders)){const l=s.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([d,h])=>{u.includes(d.toLowerCase())&&i.set(d,h)})}}if(D.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(e)),r||r!==!1&&Hr(e.url))){const l=n&&o&&Jr.read(o);l&&i.set(n,l)}return e},Yr=typeof XMLHttpRequest<"u",Gr=Yr&&function(t){return new Promise(function(e,s){const r=Jt(t);let n=r.data;const o=q.from(r.headers).normalize();let{responseType:i,onUploadProgress:a,onDownloadProgress:l}=r,u,d,h,_,f;function m(){_&&_(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(r.method.toUpperCase(),r.url,!0),p.timeout=r.timeout;function R(){if(!p)return;const C=q.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),E={data:!i||i==="text"||i==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:t,request:p};qt(function(F){e(F),m()},function(F){s(F),m()},E),p=null}"onloadend"in p?p.onloadend=R:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(R)},p.onabort=function(){p&&(s(new S("Request aborted",S.ECONNABORTED,t,p)),p=null)},p.onerror=function(C){const E=C&&C.message?C.message:"Network Error",F=new S(E,S.ERR_NETWORK,t,p);F.event=C||null,s(F),p=null},p.ontimeout=function(){let C=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const E=r.transitional||Dt;r.timeoutErrorMessage&&(C=r.timeoutErrorMessage),s(new S(C,E.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,t,p)),p=null},n===void 0&&o.setContentType(null),"setRequestHeader"in p&&c.forEach(o.toJSON(),function(C,E){p.setRequestHeader(E,C)}),c.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),i&&i!=="json"&&(p.responseType=r.responseType),l&&([h,f]=Ne(l,!0),p.addEventListener("progress",h)),a&&p.upload&&([d,_]=Ne(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",_)),(r.cancelToken||r.signal)&&(u=C=>{p&&(s(!C||C.type?new fe(null,t,p):C),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const A=Mr(r.url);if(A&&D.protocols.indexOf(A)===-1){s(new S("Unsupported protocol "+A+":",S.ERR_BAD_REQUEST,t));return}p.send(n||null)})},Xr=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let r=new AbortController,n;const o=function(u){if(!n){n=!0,a();const d=u instanceof Error?u:this.reason;r.abort(d instanceof S?d:new fe(d instanceof Error?d.message:d))}};let i=e&&setTimeout(()=>{i=null,o(new S(`timeout ${e} of ms exceeded`,S.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>c.asap(a),l}},Qr=function*(t,e){let s=t.byteLength;if(s<e){yield t;return}let r=0,n;for(;r<s;)n=r+e,yield t.slice(r,n),r=n},en=async function*(t,e){for await(const s of tn(t))yield*Qr(s,e)},tn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:s,value:r}=await e.read();if(s)break;yield r}}finally{await e.cancel()}},Kt=(t,e,s,r)=>{const n=en(t,e);let o=0,i,a=l=>{i||(i=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await n.next();if(u){a(),l.close();return}let h=d.byteLength;if(s){let _=o+=h;s(_)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},Zt=64*1024,{isFunction:Pe}=c,sn=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:Yt,TextEncoder:Gt}=c.global,Xt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},rn=t=>{t=c.merge.call({skipUndefined:!0},sn,t);const{fetch:e,Request:s,Response:r}=t,n=e?Pe(e):typeof fetch=="function",o=Pe(s),i=Pe(r);if(!n)return!1;const a=n&&Pe(Yt),l=n&&(typeof Gt=="function"?(m=>p=>m.encode(p))(new Gt):async m=>new Uint8Array(await new s(m).arrayBuffer())),u=o&&a&&Xt(()=>{let m=!1;const p=new s(D.origin,{body:new Yt,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!p}),d=i&&a&&Xt(()=>c.isReadableStream(new r("").body)),h={stream:d&&(m=>m.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!h[m]&&(h[m]=(p,R)=>{let A=p&&p[m];if(A)return A.call(p);throw new S(`Response type '${m}' is not supported`,S.ERR_NOT_SUPPORT,R)})});const _=async m=>{if(m==null)return 0;if(c.isBlob(m))return m.size;if(c.isSpecCompliantForm(m))return(await new s(D.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(c.isArrayBufferView(m)||c.isArrayBuffer(m))return m.byteLength;if(c.isURLSearchParams(m)&&(m=m+""),c.isString(m))return(await l(m)).byteLength},f=async(m,p)=>c.toFiniteNumber(m.getContentLength())??_(p);return async m=>{let{url:p,method:R,data:A,signal:C,cancelToken:E,timeout:F,onDownloadProgress:w,onUploadProgress:$,responseType:T,headers:O,withCredentials:L="same-origin",fetchOptions:le}=Jt(m),Q=e||fetch;T=T?(T+"").toLowerCase():"text";let Z=Xr([C,E&&E.toAbortSignal()],F),Y=null;const M=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let qe;try{if($&&u&&R!=="get"&&R!=="head"&&(qe=await f(O,A))!==0){let z=new s(p,{method:"POST",body:A,duplex:"half"}),te;if(c.isFormData(A)&&(te=z.headers.get("content-type"))&&O.setContentType(te),z.body){const[ht,Me]=Mt(qe,Ne(zt($)));A=Kt(z.body,Zt,ht,Me)}}c.isString(L)||(L=L?"include":"omit");const N=o&&"credentials"in s.prototype,v={...le,signal:Z,method:R.toUpperCase(),headers:O.normalize().toJSON(),body:A,duplex:"half",credentials:N?L:void 0};Y=o&&new s(p,v);let I=await(o?Q(Y,le):Q(p,v));const W=d&&(T==="stream"||T==="response");if(d&&(w||W&&M)){const z={};["status","statusText","headers"].forEach(ks=>{z[ks]=I[ks]});const te=c.toFiniteNumber(I.headers.get("content-length")),[ht,Me]=w&&Mt(te,Ne(zt(w),!0))||[];I=new r(Kt(I.body,Zt,ht,()=>{Me&&Me(),M&&M()}),z)}T=T||"text";let ee=await h[c.findKey(h,T)||"text"](I,m);return!W&&M&&M(),await new Promise((z,te)=>{qt(z,te,{data:ee,headers:q.from(I.headers),status:I.status,statusText:I.statusText,config:m,request:Y})})}catch(N){throw M&&M(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new S("Network Error",S.ERR_NETWORK,m,Y),{cause:N.cause||N}):S.from(N,N&&N.code,m,Y)}}},nn=new Map,Qt=t=>{let e=t&&t.env||{};const{fetch:s,Request:r,Response:n}=e,o=[r,n,s];let i=o.length,a=i,l,u,d=nn;for(;a--;)l=o[a],u=d.get(l),u===void 0&&d.set(l,u=a?new Map:rn(e)),d=u;return u};Qt();const tt={http:vr,xhr:Gr,fetch:{get:Qt}};c.forEach(tt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const es=t=>`- ${t}`,on=t=>c.isFunction(t)||t===null||t===!1;function an(t,e){t=c.isArray(t)?t:[t];const{length:s}=t;let r,n;const o={};for(let i=0;i<s;i++){r=t[i];let a;if(n=r,!on(r)&&(n=tt[(a=String(r)).toLowerCase()],n===void 0))throw new S(`Unknown adapter '${a}'`);if(n&&(c.isFunction(n)||(n=n.get(e))))break;o[a||"#"+i]=n}if(!n){const i=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=s?i.length>1?`since :
|
|
5
|
-
`+i.map(es).join(`
|
|
6
|
-
`):" "+es(i[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n}const ts={getAdapter:an,adapters:tt};function st(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new fe(null,t)}function ss(t){return st(t),t.headers=q.from(t.headers),t.data=et.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ts.getAdapter(t.adapter||_e.adapter,t)(t).then(function(e){return st(t),e.data=et.call(t,t.transformResponse,e),e.headers=q.from(e.headers),e},function(e){return Vt(e)||(st(t),e&&e.response&&(e.response.data=et.call(t,t.transformResponse,e.response),e.response.headers=q.from(e.response.headers))),Promise.reject(e)})}const rs="1.13.1",Ue={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ue[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const ns={};Ue.transitional=function(t,e,s){function r(n,o){return"[Axios v"+rs+"] Transitional option '"+n+"'"+o+(s?". "+s:"")}return(n,o,i)=>{if(t===!1)throw new S(r(o," has been removed"+(e?" in "+e:"")),S.ERR_DEPRECATED);return e&&!ns[o]&&(ns[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,o,i):!0}},Ue.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function cn(t,e,s){if(typeof t!="object")throw new S("options must be an object",S.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const o=r[n],i=e[o];if(i){const a=t[o],l=a===void 0||i(a,o,t);if(l!==!0)throw new S("option "+o+" must be "+l,S.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new S("Unknown option "+o,S.ERR_BAD_OPTION)}}const Fe={assertOptions:cn,validators:Ue},X=Fe.validators;let oe=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ft,response:new Ft}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const n=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?n&&!String(s.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
7
|
-
`+n):s.stack=n}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ie(this.defaults,e);const{transitional:s,paramsSerializer:r,headers:n}=e;s!==void 0&&Fe.assertOptions(s,{silentJSONParsing:X.transitional(X.boolean),forcedJSONParsing:X.transitional(X.boolean),clarifyTimeoutError:X.transitional(X.boolean)},!1),r!=null&&(c.isFunction(r)?e.paramsSerializer={serialize:r}:Fe.assertOptions(r,{encode:X.function,serialize:X.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Fe.assertOptions(e,{baseUrl:X.spelling("baseURL"),withXsrfToken:X.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=n&&c.merge(n.common,n[e.method]);n&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),e.headers=q.concat(o,n);const i=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(a=a&&f.synchronous,i.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=[ss.bind(this),void 0];for(f.unshift(...i),f.push(...l),h=f.length,u=Promise.resolve(e);d<h;)u=u.then(f[d++],f[d++]);return u}h=i.length;let _=e;for(;d<h;){const f=i[d++],m=i[d++];try{_=f(_)}catch(p){m.call(this,p);break}}try{u=ss.call(this,_)}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=ie(this.defaults,t);const e=Wt(t.baseURL,t.url,t.allowAbsoluteUrls);return Ut(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){oe.prototype[t]=function(e,s){return this.request(ie(s||{},{method:t,url:e,data:(s||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function e(s){return function(r,n,o){return this.request(ie(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}oe.prototype[t]=e(),oe.prototype[t+"Form"]=e(!0)});let ln=class Rs{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(n){s=n});const r=this;this.promise.then(n=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](n);r._listeners=null}),this.promise.then=n=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(n);return i.cancel=function(){r.unsubscribe(o)},i},e(function(n,o,i){r.reason||(r.reason=new fe(n,o,i),s(r.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=r=>{e.abort(r)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new Rs(function(s){e=s}),cancel:e}}};function un(t){return function(e){return t.apply(null,e)}}function dn(t){return c.isObject(t)&&t.isAxiosError===!0}const rt={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rt).forEach(([t,e])=>{rt[e]=t});function is(t){const e=new oe(t),s=vt(oe.prototype.request,e);return c.extend(s,oe.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(r){return is(ie(t,r))},s}const j=is(_e);j.Axios=oe,j.CanceledError=fe,j.CancelToken=ln,j.isCancel=Vt,j.VERSION=rs,j.toFormData=Le,j.AxiosError=S,j.Cancel=j.CanceledError,j.all=function(t){return Promise.all(t)},j.spread=un,j.isAxiosError=dn,j.mergeConfig=ie,j.AxiosHeaders=q,j.formToJSON=t=>$t(c.isHTMLForm(t)?new FormData(t):t),j.getAdapter=ts.getAdapter,j.HttpStatusCode=rt,j.default=j;const{Axios:Pi,AxiosError:Ui,CanceledError:Fi,isCancel:Di,CancelToken:$i,VERSION:Bi,all:Vi,Cancel:qi,isAxiosError:Mi,spread:zi,toFormData:Wi,AxiosHeaders:Hi,HttpStatusCode:Ji,formToJSON:Ki,getAdapter:Zi,mergeConfig:Yi}=j,os=j.create({baseURL:location.origin,timeout:6e4,params:{}});os.interceptors.response.use(t=>t,t=>{var e,s,r,n,o,i,a,l,u,d,h;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(m){m&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let _=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(_+=`${t.response.statusText} `),(r=(s=t.response)==null?void 0:s.config)!=null&&r.data&&(_+=`${t.response.config.data} `),(o=(n=t.response)==null?void 0:n.data)!=null&&o.message?_+=`${t.response.data.message}`:(a=(i=t.response)==null?void 0:i.data)!=null&&a.exception?_+=`${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&&(_+=`${t.response.data.error.class} `),_+=`${t.response.data.error.message}`):_+=`${(h=t.response)==null?void 0:h.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:_}),t}else throw t});let De=()=>({emit(t,...e){for(let s=this.events[t]||[],r=0,n=s.length;r<n;r++)s[r](...e)},events:{},on(t,e){var s;return((s=this.events)[t]||(s[t]=[])).push(e),()=>{var r;this.events[t]=(r=this.events[t])==null?void 0:r.filter(n=>e!==n)}}});class we extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class nt extends we{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class hn extends we{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class K extends we{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class fn extends K{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function as(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 pn{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:r,info:n})=>(s[r]=n,s),{})}}const ae=Symbol("state");class cs{constructor(e={}){this.emitter=De(),this.params=Object.freeze(e),this.presence=new pn(this),this.initialConnect=!0,this[ae]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=as({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[ae]}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[ae]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[ae]="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[ae]="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[ae]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[ae]="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 r=this.receiver?this.receiver.logger:null;r&&r.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 r=this.emitter.on(e,(...n)=>{r(),s(...n)});return r}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 r=[()=>delete this._pendingSubscribe];r.push(this.on("connect",()=>{r.forEach(n=>n()),e()})),r.push(this.on("close",n=>{r.forEach(o=>o()),s(n||new we("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class mn{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(r=>r[e](s[0])):this.channels.forEach(r=>r[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,r={promise:new Promise(o=>{s=o}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(r),1),s(r)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(r),n&&await n.promise,this.gvl&&await this.gvl.acquire(r,e),r.acquired=!0,r}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 gn{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 bn{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new gn),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:s,unsubscribe:r}){let n=this._subscriptions[e]=new mn(e);return n.remoteId=this._localToRemote[e],n.subscriber=s,n.unsubscriber=r,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,s){this._localToRemote[e]=s;let r=this.get(e);r&&(r.remoteId=s)}}class _n{constructor(e={}){this.subscriptions=new bn(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 r=s.remoteId;r&&delete this._remoteToLocal[r],this.subscriptions.remove(e)}transmit(e,s,r){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,s,r]);return}let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>{i.receive(s,r)})}notify(e,s,r){let n=this._remoteToLocal[e];if(!n)return;let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>i.emit(s,r))}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 r of this._pendingMessages)r[0]===e?this.transmit(r[0],r[1],r[2]):s.push(r);this._pendingMessages=s}}const ls={debug:0,info:1,warn:2,error:3};class us{constructor(e){this.level=e||"warn"}log(e,s,r){ls[e]<ls[this.level]||this.writeLogEntry(e,s,r)}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 ve extends us{writeLogEntry(){}}class yn{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let wn=0;class ds{constructor(e={}){let{logger:s}=e;this.logger=s||new ve,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,s){let r={channel:e};s&&Object.assign(r,s);let n=as(r);if(this.pendingUnsubscriptions[n]){let i=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${i}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},i)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let o=this.subscribeRetryInterval;return new Promise((i,a)=>{let l=++wn;this.pendingSubscriptions[n]={resolve:i,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,o)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,s,r){setTimeout(()=>{let n=this.pendingSubscriptions[s];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${r}ms, retrying subscribe`,s),this.cable.send(this.buildSubscribeRequest(s)),this.maybeExpireSubscribe(e,s,r))},r)}maybeExpireSubscribe(e,s,r){setTimeout(()=>{let n=this.pendingSubscriptions[s];n&&n.id===e&&(delete this.pendingSubscriptions[s],n.reject(new hn(`Haven't received subscription ack in ${r*2}ms for ${s}`)))},r)}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,r){return s==="$whisper"?this.whisper(e,r):(r||(r={}),r.action=s,this.cable.send({command:"message",identifier:e,data:JSON.stringify(r)}),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:r,message:n,reason:o,reconnect:i}=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 K(o);this.reset(a),i===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[r];if(!a){this.logger.error("subscription not found, unsubscribing",{type:s,identifier:r}),this.unsubscribe(r);return}return delete this.pendingSubscriptions[r],a.resolve(r)}if(s==="reject_subscription"){let a=this.pendingSubscriptions[r];return a?(delete this.pendingSubscriptions[r],a.reject(new nt)):this.logger.error("subscription not found",{type:s,identifier:r})}if(n)return{identifier:r,message:n};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 hs=()=>Date.now()/1e3|0;class vn extends ds{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=hs()),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:r,message:n}=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[r]||(this.subscriptionStreams[r]=new Set),super.receive(e);if(s==="ping")return this.restoreSince&&(this.restoreSince=hs()),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",r);return}if(s==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",r);return}if(s==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let o=e.restored_ids||Object.keys(this.subscriptionStreams);for(let i of o)this.cable.send({identifier:i,command:"history",history:this.historyRequestFor(i)}),this.presenceInfo[i]&&this.cable.send({identifier:i,command:"join",presence:this.presenceInfo[i]});return this.cable.restored(o)}return this.cable.connected(this.sessionId)}if(s==="presence"){let o=n.type;if(o==="info"){let i=this.pendingPresence[r];i&&(delete this.pendingPresence[r],i.resolve(n))}else if(o==="error"){let i=this.pendingPresence[r];i&&(delete this.pendingPresence[r],i.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:r,message:n}}if(n){let o=this.trackStreamPosition(r,e.stream_id,e.epoch,e.offset);return{identifier:r,message:n,meta:o}}this.logger.warn(`unknown message type: ${s}`,{message:e})}perform(e,s,r){switch(s){case"$presence:join":return this.join(e,r);case"$presence:leave":return this.leave(e,r);case"$presence:info":return this.presence(e,r)}return super.perform(e,s,r)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let s=super.buildSubscribeRequest(e),r=this.historyRequestFor(e);r&&(s.history=r,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(s.presence=n),s}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let s={},r=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let o=this.streamsPositions[n];o&&(r=!0,s[n]=o)}if(!(!r&&!this.restoreSince))return{since:this.restoreSince,streams:s}}trackStreamPosition(e,s,r,n){if(!(!s||!r))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(s),this.streamsPositions[s]={epoch:r,offset:n},{stream:s,epoch:r,offset:n}}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((r,n)=>{this.pendingPresence[e]={resolve:r,reject:n},this.cable.send({command:"presence",identifier:e,data:s})})}}class Sn extends we{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class it extends cs{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ke(it,"identifier","__ghost__");const En="$pubsub";class ot extends cs{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}ke(ot,"identifier",En);const ce=Symbol("state");let xn=class{constructor({transport:t,protocol:e,encoder:s,logger:r,lazy:n,hubOptions:o,performFailures:i,transportConfigurator:a}){this.emitter=De(),this.transport=t,this.encoder=s,this.logger=r||new ve,this.protocol=e,this.performFailures=i||"throw",this.protocol.attached(this),this.hub=new _n(o||{}),this[ce]="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,n===!1&&this.connect().catch(()=>{})}get state(){return this[ce]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[ce]="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[ce]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new K("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[ce]="connected",this.hub.subscriptions.all().forEach(r=>{t&&r.remoteId&&t.includes(r.remoteId)?r.notify("restored"):(r.notify("disconnected",new K("recovery_failed")),this._resubscribe(r))});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 K(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[ce]="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 K?t:new K(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[ce]="closed";let s=e||new K("cable_closed");this.hub.subscriptions.all().forEach(r=>r.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:r,identifier:n,message:o,meta:i}=s;r?this.hub.notify(n,r,o):this.hub.transmit(n,o,i)}}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 ot({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new ot({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,r;return typeof t=="string"&&(r=t,t=it),s=r?new t(r,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:r=>this._subscribe(r,t.channelId,t.params),unsubscribe:r=>this._unsubscribe(r)});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 r=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:r});return}this.logger.debug("acquiring subscribe lock",{identifier:r});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:r}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:r}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),n.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:r}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:r}),t.notify("connected"),n.release();return}let o={identifier:e,params:s};this.logger.debug("subscribing",o);try{let i=await this.protocol.subscribe(e,s);this.hub.subscribe(r,i),this.logger.debug("subscribed",{...o,remoteId:i}),t.notify("connected")}catch(i){if(i){if(i instanceof nt&&this.logger.warn("rejected",o),i instanceof K){this.logger.debug("disconnected during subscription; will retry on connect",o),n.release();return}this.logger.error("failed to subscribe",{error:i,...o})}t.close(i),this.hub.unsubscribe(r)}n.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 r=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:r}),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(r),this.logger.debug("unsubscribed remotely",{id:e})}catch(n){n&&(n instanceof K?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:n}):this.logger.error("unsubscribe failed",{id:e,error:n}))}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(r){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:r});return}}async _perform(t,e,s){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new Sn;let r=this.hub.subscriptions.get(t);if(!r)throw Error(`Subscription not found: ${t}`);if(await r.pending("subscribed"),r.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=r.remoteId,o={id:n,action:e,payload:s};this.logger.debug("perform",o);try{let i=await this.protocol.perform(n,e,s);return i&&this.logger.debug("perform result",{message:i,request:o}),i}catch(i){throw this.logger.error("perform failed",{error:i,request:o}),i}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...r)=>{s(),e(...r)});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(r=>r()),t()})),s.push(this.on("close",r=>{s.forEach(n=>n()),e(r)})),s.push(this.on("disconnect",r=>{s.forEach(n=>n()),e(r)}))}),this._pendingConnect)}};const Cn={maxMissingPings:2,maxReconnectAttempts:1/0},pe=()=>Date.now(),fs=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:r,maxInterval:n}=e;return s=s||2,r===void 0&&(r=.5),o=>{let i=t*s**o,a=i*s,l=i+(a-i)*Math.random(),u=2*(Math.random()-.5)*r;return l=l*(1+u),n&&n<l&&(l=n),l}};let ps=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},Cn,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 ve,this.state="pending_connect",this.attempts=0,this.disconnectedAt=pe()}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=pe(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=pe(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=pe(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=pe()})),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=pe()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new fn))}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 On{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=De(),this.unbind=[],this.logger=s.logger||new ve}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(r){this.logger.debug(`Failed to connect via ${s.displayName()}: ${r.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(r=>{r.setParam(e,s)})}setToken(e,s){this.transports.forEach(r=>{r.setToken(e,s)})}on(e,s){return this.emitter.on(e,s)}once(e,s){let r=this.emitter.on(e,(...n)=>{r(),s(...n)});return r}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 kn{constructor(e,s={}){this.url=e;let r=s.websocketImplementation;if(r)this.Impl=r;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=De();let{format:n,subprotocol:o,authStrategy:i}=s;this.format=n||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=i||"param",this.authProtocol="",this.subprotocol=o}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,r)=>{let n=[];n.push(this.once("open",()=>{n.forEach(o=>o()),s()})),n.push(this.once("close",()=>{n.forEach(o=>o()),r(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,s){let r=new URL(this.url);r.searchParams.set(e,s);let n=`${r.protocol}//${r.host}${r.pathname}?${r.searchParams}`;this.setURL(n)}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 r=`x-${s}`.toLowerCase();r=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===r)||r,this.connectionOptions.headers[r]=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 r=this.emitter.on(e,(...n)=>{r(),s(...n)});return r}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 ms={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Rn(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({},ms,e);let{protocol:s,websocketImplementation:r,websocketFormat:n,websocketOptions:o,websocketAuthStrategy:i,fallbacks:a,logLevel:l,logger:u,transport:d,encoder:h,lazy:_,monitor:f,pingInterval:m,reconnectStrategy:p,maxMissingPings:R,maxReconnectAttempts:A,subprotocol:C,tokenRefresher:E,historyTimestamp:F,protocolOptions:w,concurrentSubscribes:$,performFailures:T,transportConfigurator:O,auth:L}=e;if(u=u||new ve(l),typeof s=="string"){C=C||s;let Z=s.substring(0,s.lastIndexOf("-")),Y=s.substring(s.lastIndexOf("-")+1);if(w=w||{},Z==="actioncable-v1")s=new ds({logger:u,...w});else if(Z==="actioncable-v1-ext")s=new vn({logger:u,historyTimestamp:F,...w});else throw Error(`Protocol is not supported yet: ${s}`);if(Y==="json")h=h||new yn,n=n||"text";else if(Y==="msgpack"){if(n="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(Y==="protobuf"){if(n=n||"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 kn(t,{websocketImplementation:r,websocketOptions:o,subprotocol:C,authStrategy:i,format:n}),a&&(d=new On([d,...a],{logger:u})),L&&L.token&&d.setToken(L.token,L.param||"jid"),p=p||fs(m),f!==!1&&(f=f||new ps({pingInterval:m,reconnectStrategy:p,maxMissingPings:R,maxReconnectAttempts:A,logger:u}));let le={concurrentSubscribes:$},Q=new xn({protocol:s,transport:d,encoder:h,logger:u,lazy:_,hubOptions:le,performFailures:T,transportConfigurator:O});return f&&(f.watch(Q),Q.monitor=f),E&&In(Q,async()=>{try{await E(d)}catch(Z){return u.error("Failed to refresh authentication token: "+Z),!1}return Q.connect().catch(()=>{}),!0}),Q}function In(t,e){let s=!1;t.on("connect",()=>s=!1),t.on("close",async r=>{if(r){if(s){t.logger.warn("Token auto-refresh is disabled",r);return}r.reason==="token_expired"&&(s=!0,await e())}})}class An{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 Tn extends it{constructor(e,s,r){super(e,s),this.subscription=new An(this),Object.assign(this.subscription,r),this.on("connect",({reconnect:n})=>this.subscription.notify("connected",{reconnected:n})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",n=>this.subscription.notify("received",n)),this.on("close",n=>{n&&n instanceof nt?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Ln{constructor(e){this.cable=e}create(e,s){let r,n;typeof e=="object"?(r=e.channel,delete e.channel,n=e):(r=e,n={});let o=new Tn(r,n,s);return o.subscription.notify("initialized"),this.cable.subscribe(o),o.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class jn{constructor(e){this.cable=e,this.subscriptions=new Ln(e)}}class Nn extends us{writeLogEntry(e,s,r){r?console[e](s,r):console[e](s)}}class Pn extends ps{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=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},r=()=>this.disconnect(new K("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",r,!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",r,!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 Un=["cable","action-cable"],Fn="/cable",$e=(t,e)=>{for(let s of Un){let r=t.head.querySelector(`meta[name='${s}-${e}']`);if(r)return r.getAttribute("content")}},gs=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Dn=()=>{if(typeof document<"u"&&document.head){let t=$e(document,"url");if(t)return gs(t)}return gs(Fn)},$n=()=>{if(typeof document<"u"&&document.head){let t=$e(document,"history-timestamp");if(t)return t|0}},Bn=()=>{if(typeof document<"u"&&document.head)return $e(document,"token")},Vn=()=>{if(typeof document<"u"&&document.head)return $e(document,"token-param")};function qn(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Dn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=$n());let s=Bn();if(s){let u=Vn();e.auth=Object.assign({token:s,param:u},e.auth||{})}e=Object.assign({},ms,e);let{logLevel:r,logger:n,pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new Nn(r),i=e.reconnectStrategy=e.reconnectStrategy||fs(o),e.monitor!==!1&&(e.monitor=e.monitor||new Pn({pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:l,logger:n})),Rn(t,e)}function Mn(t,e){let s=qn(t,e);return new jn(s)}class bs{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,r={},n={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(o=>{if(o&&OpenC3Auth.setTokens(),this._cable==null){let i=this._url+"?scope="+encodeURIComponent(s)+"&authorization="+encodeURIComponent(localStorage.openc3Token);i=new URL(i,document.baseURI).href,this._cable=Mn(i)}return this._cable.subscriptions.create({channel:e,...n},r)})}recordPing(){}}function Se(t){return zn.test(t)}const zn=/^-?[0-9]+$/;function _s(t){return Wn.test(t)}const Wn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ys(t,e){if(Se(t))return Number.isSafeInteger(Number.parseInt(t,10));const s=Number.parseFloat(t),r=String(s);if(t===r)return!0;const n=ws(t),o=ws(r);return!!(n===o||(e==null?void 0:e.approx)===!0&&!Se(t)&&o.length>=14&&n.startsWith(o.substring(0,14)))}let Ee=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Hn(t){if(ys(t,{approx:!1}))return;if(Se(t))return Ee.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Ee.underflow:Ee.truncate_float:Ee.overflow}function ws(t){const{start:e,end:s}=Jn(t),r=t.substring(e,s),n=r.indexOf(".");return n===-1?r:r.substring(0,n)+r.substring(n+1)}function Jn(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let s=t.lastIndexOf("e");for(s===-1&&(s=t.lastIndexOf("E")),s===-1&&(s=t.length);(t[s-1]==="0"||t[s-1]===".")&&s>e;)s--;return{start:e,end:s}}class Kn{constructor(e){if(ke(this,"isLosslessNumber",!0),!_s(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Hn(this.value);if(e===void 0||e===Ee.truncate_float)return Number.parseFloat(this.value);if(Se(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 Zn(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function Yn(t){return new Kn(t)}function Gn(t,e){return at({"":t},"",t,e)}function at(t,e,s,r){return Array.isArray(s)?r.call(t,e,Qn(s,r)):s&&typeof s=="object"&&!Zn(s)?r.call(t,e,Xn(s,r)):r.call(t,e,s)}function Xn(t,e){for(const s of Object.keys(t)){const r=at(t,s,t[s],e);r!==void 0?t[s]=r:delete t[s]}return t}function Qn(t,e){for(let s=0;s<t.length;s++)t[s]=at(t,String(s),t[s],e);return t}function ei(t,e,s){const r=typeof s=="function"?{parseNumber:s}:s,n=(r==null?void 0:r.parseNumber)??Yn,o=(r==null?void 0:r.onDuplicateKey)??T;let i=0;const a=d();return A(a),E(),e?Gn(a,e):a;function l(){if(t.charCodeAt(i)===oi){i++,_();const v={};let I=!0;for(;i<t.length&&t.charCodeAt(i)!==Ss;){I?I=!1:(p(),_());const W=i,ee=f();if(ee===void 0){$();return}_(),R();const z=d();if(z===void 0){Z();return}if(Object.prototype.hasOwnProperty.call(v,ee)&&!ct(z,v[ee])){const te=o({key:ee,position:W+1,oldValue:v[ee],newValue:z});te!==void 0&&(v[ee]=te)}else v[ee]=z}return t.charCodeAt(i)!==Ss&&O(),i++,v}}function u(){if(t.charCodeAt(i)===ai){i++,_();const v=[];let I=!0;for(;i<t.length&&t.charCodeAt(i)!==Es;){I?I=!1:p();const W=d();C(W),v.push(W)}return t.charCodeAt(i)!==Es&&L(),i++,v}}function d(){_();const v=f()??m()??l()??u()??h("true",!0)??h("false",!1)??h("null",null);return _(),v}function h(v,I){if(t.slice(i,i+v.length)===v)return i+=v.length,I}function _(){for(;ti(t.charCodeAt(i));)i++}function f(){if(t.charCodeAt(i)===lt){i++;let v="";for(;i<t.length&&t.charCodeAt(i)!==lt;){if(t.charCodeAt(i)===ii){const I=t[i+1],W=ni[I];W!==void 0?(v+=W,i++):I==="u"?Be(t.charCodeAt(i+2))&&Be(t.charCodeAt(i+3))&&Be(t.charCodeAt(i+4))&&Be(t.charCodeAt(i+5))?(v+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):Y(i):Q(i)}else ri(t.charCodeAt(i))?v+=t[i]:le(t[i]);i++}return w(),i++,v}}function m(){const v=i;if(t.charCodeAt(i)===xs&&(i++,F(v)),t.charCodeAt(i)===ut)i++;else if(si(t.charCodeAt(i)))for(i++;Ve(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===mi)for(i++,F(v);Ve(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===wi||t.charCodeAt(i)===yi)for(i++,(t.charCodeAt(i)===xs||t.charCodeAt(i)===hi)&&i++,F(v);Ve(t.charCodeAt(i));)i++;if(i>v)return n(t.slice(v,i))}function p(){if(t.charCodeAt(i)!==pi)throw new SyntaxError(`Comma ',' expected after value ${N()}`);i++}function R(){if(t.charCodeAt(i)!==gi)throw new SyntaxError(`Colon ':' expected after property name ${N()}`);i++}function A(v){if(v===void 0)throw new SyntaxError(`JSON value expected ${N()}`)}function C(v){if(v===void 0)throw new SyntaxError(`Array item expected ${N()}`)}function E(){if(i<t.length)throw new SyntaxError(`Expected end of input ${N()}`)}function F(v){if(!Ve(t.charCodeAt(i))){const I=t.slice(v,i);throw new SyntaxError(`Invalid number '${I}', expecting a digit ${N()}`)}}function w(){if(t.charCodeAt(i)!==lt)throw new SyntaxError(`End of string '"' expected ${N()}`)}function $(){throw new SyntaxError(`Quoted object key expected ${N()}`)}function T(v){let{key:I,position:W}=v;throw new SyntaxError(`Duplicate key '${I}' encountered at position ${W}`)}function O(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${N()}`)}function L(){throw new SyntaxError(`Array item or end of array ']' expected ${N()}`)}function le(v){throw new SyntaxError(`Invalid character '${v}' ${M()}`)}function Q(v){const I=t.slice(v,v+2);throw new SyntaxError(`Invalid escape character '${I}' ${M()}`)}function Z(){throw new SyntaxError(`Object value expected after ':' ${M()}`)}function Y(v){const I=t.slice(v,v+6);throw new SyntaxError(`Invalid unicode character '${I}' ${M()}`)}function M(){return`at position ${i}`}function qe(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function N(){return`${qe()} ${M()}`}}function ti(t){return t===ci||t===li||t===ui||t===di}function Be(t){return t>=ut&&t<=dt||t>=bi&&t<=vi||t>=_i&&t<=Si}function Ve(t){return t>=ut&&t<=dt}function si(t){return t>=fi&&t<=dt}function ri(t){return t>=32&&t<=1114111}function ct(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,r)=>ct(s,e[r])):vs(t)&&vs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>ct(t[s],e[s])):!1}function vs(t){return typeof t=="object"&&t!==null}const ni={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
8
|
-
`,r:"\r",t:" "},ii=92,oi=123,Ss=125,ai=91,Es=93,ci=32,li=10,ui=9,di=13,lt=34,hi=43,xs=45,ut=48,fi=49,dt=57,pi=44,mi=46,gi=58,bi=65,_i=97,yi=69,wi=101,vi=70,Si=102;function Cs(t,e,s,r){return n(t);function n(l,u){if(Array.isArray(r)){const d=r.find(h=>h.test(l));if(d){const h=d.stringify(l);if(typeof h!="string"||!_s(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 o(l);if(l&&typeof l=="object")return i(l)}function o(l,u){if(l.length===0)return"[]";let d="[";for(let h=0;h<l.length;h++){const _=l[h];typeof _<"u"&&typeof _!="function"?d+=n(_):d+="null",h<l.length-1&&(d+=",")}return d+="]",d}function i(l,u){if(typeof l.toJSON=="function")return Cs(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,_="{";for(const f of d){const m=l[f];if(a(f,m)){h?h=!1:_+=",";const p=JSON.stringify(f);_+=`${p}:`,_+=n(m)}}return _+="}",_}function a(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function Ei(t){return Se(t)&&!ys(t)?BigInt(t):parseFloat(t)}class Os{constructor(){ke(this,"id",1)}async exec(e,s,r={},n={},o=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return r.scope=window.openc3Scope,n.manual=!0,(await os.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:s,id:this.id,keyword_params:r},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:o,transformRequest:[(i,a)=>Cs(i)],transformResponse:[i=>ei(i,void 0,Ei)]})).data.result}catch(i){let a=new Error;throw i.response?(a.name=i.response.data.error.data.class,a.message=i.response.data.error.data.message,a.object=i.response.data.error):i.request?(a.name="Request error",a.message="Request error, no response received"):a=i,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,r,n,o){return this.exec("map_target_to_interface",[e,s],{cmd_only:r,tlm_only:n,unmap_old:o})}unmap_target_from_interface(e,s,r,n){return this.exec("unmap_target_from_interface",[e,s],{cmd_only:r,tlm_only:n})}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,...r){return this.exec("interface_cmd",[e,s,...r])}interface_target_enable(e,s,r=!1,n=!1){return this.exec("interface_target_enable",[e,s],{cmd_only:r,tlm_only:n})}interface_target_disable(e,s,r=!1,n=!1){return this.exec("interface_target_disable",[e,s],{cmd_only:r,tlm_only:n})}interface_details(e){return this.exec("interface_details",[e])}get_all_router_info(){return this.exec("get_all_router_info",[])}map_target_to_router(e,s,r,n,o){return this.exec("map_target_to_router",[e,s],{cmd_only:r,tlm_only:n,unmap_old:o})}unmap_target_from_router(e,s,r,n){return this.exec("unmap_target_from_router",[e,s],{cmd_only:r,tlm_only:n})}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}router_target_enable(e,s,r=!1,n=!1){return this.exec("router_target_enable",[e,s],{cmd_only:r,tlm_only:n})}router_target_disable(e,s,r=!1,n=!1){return this.exec("router_target_disable",[e,s],{cmd_only:r,tlm_only:n})}router_details(e){return this.exec("router_details",[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,r){return this.exec("get_item",[e,s,r])}get_param(e,s,r){return this.exec("get_param",[e,s,r])}get_parameter(e,s,r){return this.exec("get_param",[e,s,r])}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,r,n=30){const o=await this.exec("get_tlm_packet",[e,s],{type:r,stale_time:n});if(o!=null){let i=o.length,a=null;for(let l=0;l<i;l++)a=this.decode_openc3_type(o[l][1]),a!==null&&(o[l][1]=a)}return o}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])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,s=30,r=null,n=null,o=null){let i={stale_time:s};r!==null&&(i.cache_timeout=r),n!==null&&(i.start_time=n.toISOString()),o!==null&&(i.end_time=o.toISOString());const a=await this.exec("get_tlm_values",[e],i,{},1e4);if(a&&a.length>0){let l=a[0].length,u=null;for(let d=0;d<l;d++)u=this.decode_openc3_type(a[0][d]),u!==null&&(a[0][d]=u)}return a}get_limits(e,s,r){return this.exec("get_limits",[e,s,r])}async tlm(e,s,r,n="CONVERTED"){let o=null;if(s===void 0)o=await this.exec("tlm",[e]);else if(r===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))o=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 o=await this.exec("tlm",[e,s,r],{type:n});let i=this.decode_openc3_type(o);return i!==null&&(o=i),o}async inject_tlm(e,s,r=null,n="CONVERTED"){await this.exec("inject_tlm",[e,s,r],{type:n})}set_tlm(e,s,r,n){return this.exec("set_tlm",[e,s,r],{type:n})}override_tlm(e,s,r,n){return this.exec("override_tlm",[e,s,r],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,s,r,n){return this.exec("normalize_tlm",[e,s,r],{type:n})}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,r,n="CONVERTED"){return this.exec("get_cmd_value",[e,s,r,n])}get_cmd_buffer(e,s){return this.exec("get_cmd_buffer",[e,s])}_cmd(e,s,r,n,o,i={}){let a=null;for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(a=this.encode_openc3_type(n[l]),a!==null&&(n[l]=a));return this.exec(e,[s,r,n],i,o)}get_cmd_hazardous(e,s,r,n={}){return s===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,s,r,n)}cmd(e,s,r,n={},o={}){return s===void 0?this.exec("cmd",e,o,n):this._cmd("cmd",e,s,r,n,o)}cmd_no_range_check(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_no_range_check",e,o,n):this._cmd("cmd_no_range_check",e,s,r,n,o)}cmd_raw(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_raw",e,o,n):this._cmd("cmd_raw",e,s,r,n,o)}cmd_raw_no_range_check(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,o,n):this._cmd("cmd_raw_no_range_check",e,s,r,n,o)}cmd_no_hazardous_check(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,o,n):this._cmd("cmd_no_hazardous_check",e,s,r,n,o)}cmd_no_checks(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_no_checks",e,o,n):this._cmd("cmd_no_checks",e,s,r,n,o)}cmd_raw_no_hazardous_check(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,o,n):this._cmd("cmd_raw_no_hazardous_check",e,s,r,n,o)}cmd_raw_no_checks(e,s,r,n={},o={}){return s===void 0?this.exec("cmd_raw_no_checks",e,o,n):this._cmd("cmd_raw_no_checks",e,s,r,n,o)}build_cmd(e,s,r,n={},o={}){return s===void 0?this.exec("build_cmd",e,o,n):this._cmd("build_cmd",e,s,r,n,o)}build_command(e,s,r,n={},o={}){return s===void 0?this.exec("build_cmd",e,o,n):this._cmd("build_cmd",e,s,r,n,o)}get_interface_names(){return this.exec("get_interface_names",[])}get_router_names(){return this.exec("get_router_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,r){return this.exec("save_config",[e,s,r])}delete_config(e,s){return this.exec("delete_config",[e,s])}enable_limits(e,s,r){return this.exec("enable_limits",[e,s,r])}disable_limits(e,s,r){return this.exec("disable_limits",[e,s,r])}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,s){return this.exec("get_setting",[e],s)}get_settings(e,s){return this.exec("get_settings",e,s)}set_setting(e,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}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),r=await crypto.subtle.digest("SHA-256",s),n=new Uint8Array(r);return Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("")}}}const xi={components:{ValueWidget:yt,ValuelimitsbarWidget:wt},mixins:[ze],props:{modelValue:{type:Array,default:()=>[]},timeZone:{type:String,default:"local"}},data(){return{api:null,cable:new bs,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:"410px"},{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 Os;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(n=>s.includes(n)))continue;this.itemList.push(s);let r={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"?r.limits=!1:r.limits=!0,this.items.push(r)}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,r,n]=t.split("__"),o=`${s}__${r}`;for(this.ignored.push(o),e||this.updateIgnored();;){let i=this.itemList.findIndex(a=>a.includes(o));if(i===-1)break;{let a=this.itemList[i].lastIndexOf("__");this.removeItem(this.itemList[i].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 r=`${s.target_name}__${s.packet_name}__${s.item_name}`;const n=this.itemList.findIndex(i=>i.includes(r));if(n!==-1){this.itemList[n]=`${r}__${s.new_limits_state}`,this.calcOverallState();continue}if(this.ignored.find(i=>r.includes(i))||s.new_limits_state&&!(s.new_limits_state.includes("YELLOW")||s.new_limits_state.includes("RED")))continue;let o={key:r,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"?o.limits=!1:o.limits=!0,this.itemList.push(`${r}__${s.new_limits_state}`),this.items.push(o),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 r of s.parameters)if(r.toLowerCase().includes(e))return!0}return!!(s.timestamp&&s.timestamp.toLowerCase().includes(e)||s.key&&s.key.toLowerCase().includes(e))}}},Ci=["status"],Oi={class:"font-weight-black"};function ki(t,e,s,r,n,o){const i=y("v-text-field"),a=y("v-spacer"),l=y("v-row"),u=y("valuelimitsbar-widget"),d=y("value-widget"),h=y("v-btn"),_=y("v-icon"),f=y("v-list-item-title"),m=y("v-list-item"),p=y("v-list"),R=y("v-menu"),A=y("v-data-table"),C=y("v-card"),E=y("v-toolbar"),F=y("v-divider"),w=y("v-card-text"),$=y("v-card-actions"),T=y("v-dialog");return k(),H("div",null,[b(C,{class:"pa-5"},{default:g(()=>[b(l,{class:"ma-1"},{default:g(()=>[b(i,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Overall Limits State","model-value":o.overallStateFormatted,class:He(o.textFieldClass),style:{"margin-right":"10px","max-width":"280px"},"data-test":"overall-state"},Oe({_:2},[o.astroStatus?{name:"prepend-inner",fn:g(()=>[B("rux-status",{status:o.astroStatus},null,8,Ci)]),key:"0"}:void 0]),1032,["model-value","class"]),b(i,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Current Limits Set","model-value":n.currentLimitsSet,style:{"max-width":"200px"},"data-test":"limits-set"},null,8,["model-value"]),b(a),b(i,{modelValue:n.search,"onUpdate:modelValue":e[0]||(e[0]=O=>n.search=O),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}),b(A,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[1]||(e[1]=O=>n.itemsPerPage=O),headers:n.headers,items:n.items,search:n.search,"custom-filter":o.customFilter,"item-value":"key","data-test":"limits-table",class:"limits-table",density:"compact"},{"item.timestamp":g(({item:O})=>[U(G(O.timestamp),1)]),"item.value":g(({item:O})=>[O.limits?(k(),P(u,{key:0,parameters:O.parameters,settings:n.valueLimitsBarWidgetSettings,"screen-values":n.screenValues,"screen-time-zone":s.timeZone,onAddItem:o.addItem,onDeleteItem:o.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"])):(k(),P(d,{key:1,parameters:O.parameters,settings:n.valueWidgetSettings,"screen-values":n.screenValues,"screen-time-zone":s.timeZone,onAddItem:o.addItem,onDeleteItem:o.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"]))]),"item.actions":g(({item:O})=>[b(R,null,{activator:g(({props:L})=>[b(h,Ce({icon:"mdi-dots-horizontal",variant:"text",density:"compact","aria-label":"Item Options"},L),null,16)]),default:g(()=>[b(p,null,{default:g(()=>[b(m,{onClick:L=>o.ignorePacket(O.key)},{prepend:g(()=>[b(_,null,{default:g(()=>[...e[4]||(e[4]=[U("mdi-close-circle-multiple",-1)])]),_:1})]),default:g(()=>[b(f,null,{default:g(()=>[...e[5]||(e[5]=[U("Ignore Entire Packet",-1)])]),_:1})]),_:1},8,["onClick"]),b(m,{onClick:L=>o.ignoreItem(O.key)},{prepend:g(()=>[b(_,null,{default:g(()=>[...e[6]||(e[6]=[U("mdi-close-circle",-1)])]),_:1})]),default:g(()=>[b(f,null,{default:g(()=>[...e[7]||(e[7]=[U("Ignore Item",-1)])]),_:1})]),_:1},8,["onClick"]),b(m,{onClick:L=>o.removeItem(O.key)},{prepend:g(()=>[b(_,null,{default:g(()=>[...e[8]||(e[8]=[U("mdi-eye-off",-1)])]),_:1})]),default:g(()=>[b(f,null,{default:g(()=>[...e[9]||(e[9]=[U("Temporarily Hide Item",-1)])]),_:1})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]),"item.limits":g(({item:O})=>[b(a)]),_:1},8,["items-per-page","headers","items","search","custom-filter"]),e[10]||(e[10]=B("div",{class:"footer"},' Note: Timestamp is "now" for items currently out of limits when the page is loaded. ',-1))]),_:1}),b(T,{modelValue:n.ignoredItemsDialog,"onUpdate:modelValue":e[3]||(e[3]=O=>n.ignoredItemsDialog=O),"max-width":"600"},{default:g(()=>[b(C,null,{default:g(()=>[b(E,{height:"24"},{default:g(()=>[b(a),e[11]||(e[11]=B("span",null,"Ignored Items",-1)),b(a)]),_:1}),b(w,{class:"mt-2"},{default:g(()=>[B("div",null,[(k(!0),H(se,null,ue(o.ignoredFormatted,(O,L)=>(k(),H("div",{key:L},[b(l,{class:"ma-1 align-center"},{default:g(()=>[B("span",Oi,G(O),1),b(a),b(h,{icon:"mdi-delete",density:"compact",variant:"text","aria-label":"Remove Ignored Item","data-test":`remove-ignore-${L}`,onClick:le=>o.restoreItem(L)},null,8,["data-test","onClick"])]),_:2},1024),L<o.ignoredFormatted.length-1?(k(),P(F,{key:L})):re("",!0)]))),128))])]),_:1}),b($,{class:"px-2"},{default:g(()=>[b(h,{variant:"outlined",onClick:o.clearAll},{default:g(()=>[...e[12]||(e[12]=[U(" Clear All ",-1)])]),_:1},8,["onClick"]),b(a),b(h,{variant:"flat",onClick:e[2]||(e[2]=O=>n.ignoredItemsDialog=!1)},{default:g(()=>[...e[13]||(e[13]=[U(" Ok ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Ri=xe(xi,[["render",ki],["__scopeId","data-v-71a2dc86"]]),Ii={mixins:[ze],props:{historyCount:{type:Number,default:1e3},timeZone:{type:String,default:"local"}},data(){return{data:[],cable:new bs,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":"openc3-white"},calcTableHeight(){return window.innerHeight-250}}},Ai=["status"];function Ti(t,e,s,r,n,o){const i=y("v-spacer"),a=y("v-text-field"),l=y("v-card-title"),u=y("v-data-table"),d=y("v-card");return k(),P(d,{class:"card-height"},{default:g(()=>[b(l,{class:"d-flex align-center"},{default:g(()=>[e[1]||(e[1]=U(" Limits Events ",-1)),b(i),b(a,{modelValue:n.search,"onUpdate:modelValue":e[0]||(e[0]=h=>n.search=h),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),b(u,{headers:n.headers,items:n.data,search:n.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact",height:o.calcTableHeight(),hover:"","data-test":"limits-events"},{"item.time_nsec":g(({item:h})=>[B("span",null,G(t.formatNanoseconds(h.time_nsec,s.timeZone)),1)]),"item.level":g(({item:h})=>[B("rux-status",{status:o.getStatus(h.message)},null,8,Ai)]),"item.message":g(({item:h})=>[B("span",{class:He(o.getColorClass(h.message))},G(h.message),3)]),_:1},8,["headers","items","search","height"])]),_:1})}const Li={components:{LimitsControl:Ri,LimitsEvents:xe(Ii,[["render",Ti],["__scopeId","data-v-3c276116"]]),TopBar:js,OpenConfigDialog:gt,SaveConfigDialog:mt},mixins:[pt],data(){return{title:"Limits Monitor",configKey:"limits_monitor",api:new Os,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 ji(t,e,s,r,n,o){const i=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"),_=y("v-toolbar"),f=y("v-select"),m=y("v-card-text"),p=y("v-btn"),R=y("v-card-actions"),A=y("v-card"),C=y("v-dialog");return k(),H("div",null,[b(i,{menus:n.menus,title:n.title},null,8,["menus","title"]),(k(),P(a,{ref:"control",key:n.renderKey,modelValue:n.ignored,"onUpdate:modelValue":e[0]||(e[0]=E=>n.ignored=E),"time-zone":n.timeZone},null,8,["modelValue","time-zone"])),e[12]||(e[12]=B("div",{style:{height:"15px"}},null,-1)),b(l,{"time-zone":n.timeZone},null,8,["time-zone"]),n.openConfig?(k(),P(u,{key:0,modelValue:n.openConfig,"onUpdate:modelValue":e[1]||(e[1]=E=>n.openConfig=E),"config-key":n.configKey,onSuccess:o.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):re("",!0),n.saveConfig?(k(),P(d,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[2]||(e[2]=E=>n.saveConfig=E),"config-key":n.configKey,onSuccess:o.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):re("",!0),b(C,{modelValue:n.limitsSetDialog,"onUpdate:modelValue":e[5]||(e[5]=E=>n.limitsSetDialog=E),"max-width":"650",persistent:"",onKeydown:e[6]||(e[6]=_t(E=>n.limitsSetDialog=!1,["esc"]))},{default:g(()=>[b(A,null,{default:g(()=>[b(_,{height:"24"},{default:g(()=>[b(h),e[7]||(e[7]=B("span",null,"Change Limits Set",-1)),b(h)]),_:1}),b(m,{class:"mt-6"},{default:g(()=>[e[8]||(e[8]=B("span",{style:{display:"block"}}," The Limits Set is a global option which changes the Limits Set across all tools. ",-1)),e[9]||(e[9]=B("span",{style:{display:"block"}}," NOTE: Changing this option clears the current list and recalculates based on the new set. ",-1)),b(f,{modelValue:n.currentLimitsSet,"onUpdate:modelValue":e[3]||(e[3]=E=>n.currentLimitsSet=E),label:"Limits Set",items:n.limitsSets,density:"compact",variant:"outlined","data-test":"limits-set","hide-details":"",class:"mt-3",style:{"max-width":"200px"}},null,8,["modelValue","items"])]),_:1}),b(R,{class:"px-2"},{default:g(()=>[b(h),b(p,{variant:"outlined",onClick:e[4]||(e[4]=E=>n.limitsSetDialog=!1)},{default:g(()=>[...e[10]||(e[10]=[U(" Cancel ",-1)])]),_:1}),b(p,{variant:"flat",onClick:o.setLimitsSet},{default:g(()=>[...e[11]||(e[11]=[U(" Ok ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Xi=Is("default",xe(Li,[["render",ji]]))}}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./Layout-CrCMUbtG-db0ee1c21c4515add7f4.js","vue","./main-aa2b3090dbae2d05f657.js","./Widget-Cx1jBJHK-ced10deedfc13f34afdc.js","vue-router","single-spa","vuex","vuetify"],function(C,k){"use strict";var a,l,s,n,c,o,i,u,m,d,p,g;return{setters:[e=>{a=e.r},e=>{l=e.resolveComponent,s=e.createBlock,n=e.openBlock,c=e.normalizeStyle,o=e.withCtx,i=e.createElementBlock,u=e.Fragment,m=e.renderList,d=e.resolveDynamicComponent,p=e.mergeProps},e=>{g=e.d},null,null,null,null,null],execute:function(){const e={mixins:[a],data(){return{selectedIndex:0}},created(){this.parameters[0]&&(this.selectedIndex=parseInt(this.parameters[0]))},methods:{selected(){return this.selectedIndex}}};function h(r,v,I,j,y,z){const f=l("v-radio-group");return n(),s(f,{"hide-details":"",density:"compact",modelValue:y.selectedIndex,"onUpdate:modelValue":v[0]||(v[0]=t=>y.selectedIndex=t),style:c(r.computedStyle)},{default:o(()=>[(n(!0),i(u,null,m(r.widgets,(t,x)=>(n(),s(d(t.type),p({ref_for:!0},r.listeners,{value:x,key:x,target:t.target,parameters:t.parameters,settings:t.settings,"screen-values":r.screenValues,"screen-time-zone":r.screenTimeZone,name:t.name}),null,16,["value","target","parameters","settings","screen-values","screen-time-zone","name"]))),128))]),_:1},8,["modelValue","style"])}const B=C("default",g(e,[["render",h]]))}}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./Layout-CrCMUbtG-db0ee1c21c4515add7f4.js","vue","./main-aa2b3090dbae2d05f657.js","./Widget-Cx1jBJHK-ced10deedfc13f34afdc.js","vue-router","single-spa","vuex","vuetify"],function(C,_){"use strict";var p,l,s,r,g,v,i,u,c,o,y,f,b,w,V;return{setters:[e=>{p=e.r},e=>{l=e.resolveComponent,s=e.createElementBlock,r=e.openBlock,g=e.createVNode,v=e.normalizeStyle,i=e.withCtx,u=e.Fragment,c=e.renderList,o=e.createBlock,y=e.createTextVNode,f=e.toDisplayString,b=e.resolveDynamicComponent,w=e.mergeProps},e=>{V=e.d},null,null,null,null,null],execute:function(){const e={mixins:[p],data:function(){return{curTab:null}},watch:{curTab:function(){this.$emit("min-max-screen")}}};function k(t,m,h,j,D,L){const x=l("v-tab"),T=l("v-tabs"),B=l("v-window-item"),S=l("v-window");return r(),s("div",null,[g(T,{modelValue:t.curTab,"onUpdate:modelValue":m[0]||(m[0]=a=>t.curTab=a),style:v(t.computedStyle)},{default:i(()=>[(r(!0),s(u,null,c(t.widgets,(a,d)=>(r(),o(x,{key:d},{default:i(()=>[y(f(a.parameters[0]),1)]),_:2},1024))),128))]),_:1},8,["modelValue","style"]),g(S,{modelValue:t.curTab,"onUpdate:modelValue":m[1]||(m[1]=a=>t.curTab=a)},{default:i(()=>[(r(!0),s(u,null,c(t.widgets,(a,d)=>(r(),o(B,{key:d},{default:i(()=>[(r(!0),s(u,null,c(a.widgets,(n,N)=>(r(),o(b(n.type),w({ref_for:!0},t.listeners,{key:`${d}-${N}`,target:n.target,parameters:n.parameters,settings:n.settings,"screen-values":t.screenValues,"screen-time-zone":t.screenTimeZone,widgets:n.widgets,name:n.name,line:n.line,"line-number":n.lineNumber}),null,16,["target","parameters","settings","screen-values","screen-time-zone","widgets","name","line","line-number"]))),128))]),_:2},1024))),128))]),_:1},8,["modelValue"])])}const z=C("default",V(e,[["render",k]]))}}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./main-aa2b3090dbae2d05f657.js","./Widget-Cx1jBJHK-ced10deedfc13f34afdc.js"],function(a,n){"use strict";var r,i;return{setters:[s=>{r=s.R},s=>{i=s.o}],execute:function(){const s={methods:{formatValueBase(e,t){return this.isJsonString(e)?this.formatJsonString(e):Array.isArray(e)?this.formatArray(e):this.isObject(e)?"":t&&e?sprintf(t,e):String(e)},isJsonString(e){return e&&e.json_class==="String"&&e.raw!==void 0},formatJsonString(e){let t=Array.from(e.raw.slice(0,32),l=>("0"+(l&255).toString(16)).slice(-2)).join(" ").toUpperCase();return e.raw.length>32&&(t+="..."),t},formatArray(e){return"["+e.map(t=>typeof t=="string"?`"${t}"`:t).join(", ")+"]"},isObject(e){return Object.prototype.toString.call(e).slice(8,-1)==="Object"}}},u=a("h",{mixins:[i,r,s],props:{value:{default:null},limitsState:{type:String,default:null},counter:{default:null},formatString:null,timeZone:{type:String,default:"local"}},emits:["addItem","deleteItem","open"],data(){return{appliedTimeZone:"local",curValue:null,prevValue:null,grayLevel:80,grayRate:5,valueId:null,arrayIndex:null,viewDetails:!1,contextMenuShown:!1,x:0,y:0,contextMenuOptions:[{title:"Details",action:()=>{this.contextMenuShown=!1,this.viewDetails=!0}},{title:"Graph",action:()=>{window.open("/tools/tlmgrapher/"+encodeURIComponent(this.parameters[0])+"/"+encodeURIComponent(this.parameters[1])+"/"+encodeURIComponent(this.parameters[2])+"/","_blank")}}]}},watch:{_counter:function(e,t){this.curValue!==this.prevValue?this.grayLevel=80:(this.grayLevel-=this.grayRate,this.grayLevel<30&&(this.grayLevel=30)),this.prevValue=this.curValue}},computed:{_value:function(){return this.curValue=this.value,this.curValue===null&&(this.screenValues?this.screenValues[this.valueId]&&(this.arrayIndex!==null&&this.screenValues[this.valueId][0]?this.curValue=this.screenValues[this.valueId][0][this.arrayIndex]:this.curValue=this.screenValues[this.valueId][0]):this.curValue=null),this.curValue=this.formatValue(this.curValue),this.curValue},_limitsState:function(){let e=this.limitsState;return e===null&&(this.screenValues?this.screenValues[this.valueId]&&(e=this.screenValues[this.valueId][1]):e=null),e},_counter:function(){let e=this.counter;return e===null&&(this.screenValues?this.screenValues[this.valueId]&&(e=this.screenValues[this.valueId][2]):e=null),e},valueClass:function(){return"value shrink pa-1 openc3-"+this.limitsColor},astroStatus(){switch(this.limitsColor){case"green":return"normal";case"yellow":return"caution";case"red":return"critical";case"blue":return"standby";default:return null}},limitsColor(){let e=this._limitsState;if(e!=null)switch(e){case"GREEN":case"GREEN_HIGH":case"GREEN_LOW":return"green";case"YELLOW":case"YELLOW_HIGH":case"YELLOW_LOW":return"yellow";case"RED":case"RED_HIGH":case"RED_LOW":return"red";case"BLUE":return"blue";case"STALE":return"purple";default:return"white"}return""},limitsLetter(){let e=this._limitsState;if(e!=null){let t=e.charAt(0);return e.endsWith("_LOW")&&(t=t.toLowerCase()),t}return""}},created(){if(this.value===null||this.limitsState===null){if(this.parameters[2].includes("[["))this.parameters[2]=this.parameters[2].replace("[[","[").replace("]]","]");else if(this.parameters[2].includes("[")){let e=this.parameters[2].match(/\[(\d+)\]/);this.arrayIndex=parseInt(e[1]),this.parameters[2]=this.parameters[2].replace(e[0],"")}this.valueId=`${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__${this.getType()}`,this.$emit("addItem",this.valueId),this.screenTimeZone?this.appliedTimeZone=this.screenTimeZone:this.appliedTimeZone=this.timeZone}},destroyed(){(this.value===null||this.limitsState===null)&&this.$emit("deleteItem",this.valueId)},methods:{getType(){let e="WITH_UNITS";return this.parameters[3]&&(e=this.parameters[3]),e},formatValue(e){try{return e&&this.valueId&&(this.valueId.toUpperCase().includes("PACKET_TIMEFORMATTED")||this.valueId.toUpperCase().includes("RECEIVED_TIMEFORMATTED"))&&(e=this.formatUtcToLocal(new Date(e.replaceAll("/","-")),this.appliedTimeZone)),this.formatValueBase(e,this.formatString)}catch(t){return console.log(`${this.valueId} formatValue on ${e} with ${this.formatString} failed due to ${t}`),e}},showContextMenu(e){e.preventDefault(),this.contextMenuShown=!1,this.x=e.clientX,this.y=e.clientY,this.$nextTick(()=>{this.contextMenuShown=!0})}}})}}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./ValueWidget-QaBYsiZz-6c282d12a740afb69483.js","./LimitscolumnWidget-D-IPNDVg-1dff9d2c7748edbd62fd.js","./Widget-Cx1jBJHK-ced10deedfc13f34afdc.js","vue","./main-aa2b3090dbae2d05f657.js","./DetailsDialog-DxYZre4A-18843fd5daf1ed05e2e7.js","single-spa","./VWidget-A802LGvR-1f0bc51907a47fd7869f.js","vue-router","vuex","vuetify","./BarColumn-CUO9ur6W-2a92f33d779c53d73a6a.js"],function(g,f){"use strict";var l,i,a,n,u,o,c,s,r,m;return{setters:[e=>{l=e.default},e=>{i=e.default},e=>{a=e.o},e=>{n=e.resolveComponent,u=e.createElementBlock,o=e.openBlock,c=e.normalizeStyle,s=e.createVNode,r=e.mergeProps},e=>{m=e.d},null,null,null,null,null,null,null],execute:function(){const e={mixins:[a],components:{ValueWidget:l,LimitscolumnWidget:i}};function d(t,j,x,B,W,w){const p=n("limitscolumn-widget"),v=n("value-widget");return o(),u("div",{ref:"container",style:c(t.computedStyle)},[s(p,r(t.$attrs,{parameters:t.parameters,settings:[...t.appliedSettings],"screen-values":t.screenValues,"widget-index":1,line:t.line,lineNumber:t.lineNumber}),null,16,["parameters","settings","screen-values","line","lineNumber"]),s(v,r(t.$attrs,{parameters:t.parameters,settings:[...t.appliedSettings],"screen-values":t.screenValues,"screen-time-zone":t.screenTimeZone,"widget-index":0}),null,16,["parameters","settings","screen-values","screen-time-zone"])],4)}const V=g("default",m(e,[["render",d]]))}}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./LabelWidget-BehwzOCR-3a4aefd5239727fde942.js","./HorizontallineWidget-DZcIetQh-cfe5249f067ca2a0070a.js","./VerticalWidget-C8iN5DJK-6dcf0704901b6ba19dd3.js","./Layout-CrCMUbtG-db0ee1c21c4515add7f4.js","vue","./main-aa2b3090dbae2d05f657.js","./Widget-Cx1jBJHK-ced10deedfc13f34afdc.js","vue-router","single-spa","vuex","vuetify"],function(m,W){"use strict";var r,l,a,o,s,c,n,g,d,i,u,p;return{setters:[e=>{r=e.default},e=>{l=e.default},e=>{a=e.default},e=>{o=e.r},e=>{s=e.resolveComponent,c=e.createElementBlock,n=e.openBlock,g=e.createBlock,d=e.createCommentVNode,i=e.createVNode,u=e.mergeProps},e=>{p=e.d},null,null,null,null,null],execute:function(){const e={components:{LabelWidget:r,HorizontalLineWidget:l,VerticalWidget:a},mixins:[o],created(){this.labelSettings=[...this.appliedSettings],this.labelSettings.find(t=>t[0]==="0"&&t[1].startsWith("RAW")&&t[2]==="font-weight")||this.labelSettings.push(["0","RAW__font-weight","font-weight","bold"])}};function h(t,C,S,B,V,j){const w=s("label-widget"),f=s("horizontal-line-widget"),v=s("vertical-widget");return n(),c("div",null,[t.parameters.length>0?(n(),g(w,{key:0,parameters:t.parameters.slice(0,1),settings:[...t.labelSettings],"widget-index":0},null,8,["parameters","settings"])):d("",!0),i(f,{settings:[...t.appliedSettings],"widget-index":1},null,8,["settings"]),i(v,u(t.listeners,{parameters:t.parameters.slice(1),settings:t.settings,widgets:t.widgets,"screen-values":t.screenValues,"screen-time-zone":t.screenTimeZone}),null,16,["parameters","settings","widgets","screen-values","screen-time-zone"])])}const b=m("default",p(e,[["render",h]]))}}});
|