openc3-cosmos-tool-limitsmonitor 6.7.0 → 6.8.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.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/tools/limitsmonitor/ArrayWidget-j3ncPuPx-48ec10cff87d7bb688fd.js +2 -0
  3. data/tools/limitsmonitor/ArrayplotWidget-DuLaiGa9-34288673fdb38dee3ea7.js +1 -0
  4. data/tools/limitsmonitor/BarColumn-BWJ0Dd4O-f81952b47d4ae7a2ae18.js +1 -0
  5. data/tools/limitsmonitor/BlockWidget-Bf5Dd6Cr-69ba204cef2687bc756a.js +2 -0
  6. data/tools/limitsmonitor/ButtonWidget-bl_mGFYh-90c9cb7e6c91614f31c9.js +2 -0
  7. data/tools/limitsmonitor/CanvasWidget-boDemgx1-97a4cac8b7e9de6be9f2.js +1 -0
  8. data/tools/limitsmonitor/CanvasdotWidget-BZBbJcER-43a7f291151bcf40fe2a.js +1 -0
  9. data/tools/limitsmonitor/CanvasimageWidget-6ywvT5jd-5ec440c7b5b99435a503.js +1 -0
  10. data/tools/limitsmonitor/CanvasimagevalueWidget-DjWrA3gX-4b2220af6c6cadf9a8cb.js +1 -0
  11. data/tools/limitsmonitor/CanvaslabelWidget-Bq4V2BQh-5ee08e6fbaeea245aac7.js +1 -0
  12. data/tools/limitsmonitor/CanvaslabelvalueWidget-C8oNcFLi-70b7f538e13f1a47b459.js +1 -0
  13. data/tools/limitsmonitor/CanvaslineWidget-nvbL2GoL-f1062091f1af89ae4a36.js +1 -0
  14. data/tools/limitsmonitor/CanvaslinevalueWidget-ZACQedKx-e1f211747d1e089dcf9b.js +1 -0
  15. data/tools/limitsmonitor/CheckbuttonWidget-B82UE8AB-ffa03a27065981db7431.js +1 -0
  16. data/tools/limitsmonitor/ComboboxWidget-4OFiSkI6-e6541f0edd529314d752.js +1 -0
  17. data/tools/limitsmonitor/DateWidget-BmwtdirF-ad3b1abe13eab26eb21b.js +1 -0
  18. data/tools/limitsmonitor/DetailsDialog-CLKEfU0s-9a7b4535747d1b9bf6ca.js +1 -0
  19. data/tools/limitsmonitor/DynamicWidget-CfMtj7H8-998735d161733a4193a7.js +1 -0
  20. data/tools/limitsmonitor/FormatvalueWidget-C8exC3bj-dc32ab2c73d3e1b0ae70.js +1 -0
  21. data/tools/limitsmonitor/Graph-CWcrowaT-1cce2dabc839afb8fe98.js +1 -0
  22. data/tools/limitsmonitor/GraphWidget-CvzxZYVx-89531f2125ce63ecf09d.js +1 -0
  23. data/tools/limitsmonitor/HorizontalWidget-Ck151zVw-ded02c333872cf7ed955.js +1 -0
  24. data/tools/limitsmonitor/HorizontalboxWidget-D3P-cl9V-877ebfed6261938d6172.js +1 -0
  25. data/tools/limitsmonitor/HorizontallineWidget-BE1TjPU8-bef909846959fc0c8d0f.js +1 -0
  26. data/tools/limitsmonitor/IframeWidget-BgJCgues-66ddc95ffc3b2b136951.js +1 -0
  27. data/tools/limitsmonitor/ImageLoader-CWn-PLOk-ca73d77c23971a7b005a.js +1 -0
  28. data/tools/limitsmonitor/ImageviewerWidget-BlhFZD2f-88e73cff9f99fcc33e10.js +1 -0
  29. data/tools/limitsmonitor/LabelWidget-Cwosk4x2-731a00eb5ae7f17cd400.js +1 -0
  30. data/tools/limitsmonitor/LabelledWidget-Dl6rAFTQ-90f978df790a2483276f.js +1 -0
  31. data/tools/limitsmonitor/LabelprogressbarWidget-MuAKesOz-979c43bca7dedbadedfa.js +1 -0
  32. data/tools/limitsmonitor/LabelsparklineWidget-6LA6Ox3d-3eb71dfb70e90f923ae7.js +1 -0
  33. data/tools/limitsmonitor/LabelvalueWidget-BxAXx-Tf-c79d9f6bede43033b9ad.js +1 -0
  34. data/tools/limitsmonitor/LabelvaluedescWidget-Dwwlnd1g-21901fb4389a6111424f.js +1 -0
  35. data/tools/limitsmonitor/LabelvaluelimitsbarWidget-Dv8Qk8kK-50273abdf3711cf5a751.js +1 -0
  36. data/tools/limitsmonitor/LabelvaluelimitscolumnWidget-D-_gl6fq-a9b87d69ef6ec001960d.js +1 -0
  37. data/tools/limitsmonitor/LabelvaluerangebarWidget-B3MKT-3Y-3d93eae4f87096487503.js +1 -0
  38. data/tools/limitsmonitor/Layout-Bkb6VP3e-b0eecb7313ea4ca58071.js +1 -0
  39. data/tools/limitsmonitor/LedWidget-DOuDD8LI-61a268161ea668b2d2a5.js +1 -0
  40. data/tools/limitsmonitor/{LimitsMonitor-d57f8209525f7ca4c877.js → LimitsMonitor-ae40c17c4fae24024d85.js} +7 -7
  41. data/tools/limitsmonitor/LimitsbarWidget-D1U6SvVL-ebcbade450042d3f5a24.js +1 -0
  42. data/tools/limitsmonitor/LimitscolorWidget-iSMGusqt-d7ad68317bfa6b267a35.js +1 -0
  43. data/tools/limitsmonitor/LimitscolumnWidget-DjxZTt_r-eb5c36cbfbfe7b24f572.js +1 -0
  44. data/tools/limitsmonitor/LinegraphWidget-BHKU6zlT-156e727039ff5e74646b.js +1 -0
  45. data/tools/limitsmonitor/MatrixbycolumnsWidget-BKO-A2QD-63e2733f87f6370775af.js +1 -0
  46. data/tools/limitsmonitor/ProgressbarWidget-fbr2qu_N-cc4e02f5442c9c9c8014.js +1 -0
  47. data/tools/limitsmonitor/RadiobuttonWidget-DL08zcQT-69de87fe86001038bc27.js +1 -0
  48. data/tools/limitsmonitor/RadiogroupWidget-DW9Xpj3c-b5175ff8b73804725aee.js +1 -0
  49. data/tools/limitsmonitor/RangebarWidget-o9q55kjc-25b9dc1e9c94afadadf7.js +1 -0
  50. data/tools/limitsmonitor/RollupWidget-BHnjj-DF-2f3f7cec24aa8a01beb2.js +1 -0
  51. data/tools/limitsmonitor/ScrollwindowWidget-D-QVwztC-17abfa2bbe87ef54aa39.js +1 -0
  52. data/tools/limitsmonitor/SignalWidget-CsWuufdx-29c15bd13612114e510a.js +1 -0
  53. data/tools/limitsmonitor/SpacerWidget-Di9-qunj-e969e4e34369288535bc.js +1 -0
  54. data/tools/limitsmonitor/SparklineWidget-B6-zhdPW-4b537294a10bb75614f4.js +1 -0
  55. data/tools/limitsmonitor/TabbookWidget-B1E1_mzA-ab18587edefcdd392c15.js +1 -0
  56. data/tools/limitsmonitor/TextboxWidget-CBVEXPw_-b6cf6e628c110910d948.js +1 -0
  57. data/tools/limitsmonitor/TextfieldWidget-DZMHrtQa-57c744bcf127d97d2626.js +1 -0
  58. data/tools/limitsmonitor/TimeWidget-K4MNmJ7J-1307b1b77d4ffe3625fe.js +1 -0
  59. data/tools/limitsmonitor/TitleWidget-8IcwweFE-960099da305c28322409.js +1 -0
  60. data/tools/limitsmonitor/VWidget-CoIgX3hM-ed969512a423fe7d5562.js +1 -0
  61. data/tools/limitsmonitor/ValueWidget-BvT1ASar-9c1637b35b4543df3eec.js +1 -0
  62. data/tools/limitsmonitor/ValuelimitsbarWidget-C5lBnUmB-c71fd8149317d9bceda1.js +1 -0
  63. data/tools/limitsmonitor/ValuelimitscolumnWidget-DHYI0WBL-cd0e2daf5352df40a252.js +1 -0
  64. data/tools/limitsmonitor/ValuerangebarWidget-BSszZhlE-b2f1ca5f69c9646cb6cf.js +1 -0
  65. data/tools/limitsmonitor/VerticalWidget-1GhgYrC3-c2b48826ad43a2ce6c38.js +1 -0
  66. data/tools/limitsmonitor/VerticalboxWidget-DYHJqEzd-32a31c2f72ac7a838702.js +1 -0
  67. data/tools/limitsmonitor/Widget-B8t93Oid-cdbbb47eb4c635a756f1.js +1 -0
  68. data/tools/limitsmonitor/main-4ea7df8746eb0bc0fbc8.js +1502 -0
  69. data/tools/limitsmonitor/main.js +1 -1
  70. metadata +69 -69
  71. data/tools/limitsmonitor/ArrayWidget-BSG8KEtf-5f0df4036ee67158e3cd.js +0 -2
  72. data/tools/limitsmonitor/ArrayplotWidget-WVu76Kqn-3a311c357e87f4f34d5e.js +0 -1
  73. data/tools/limitsmonitor/BarColumn-Cflh9pUz-72d77005b1381ec6b473.js +0 -1
  74. data/tools/limitsmonitor/BlockWidget-B7ryWGCq-b992121f106cab0b8f7a.js +0 -2
  75. data/tools/limitsmonitor/ButtonWidget-BKih3ix9-ceef7e8b29bcd8e6a49f.js +0 -2
  76. data/tools/limitsmonitor/CanvasWidget-DT9xMSfb-51dafda176624d985542.js +0 -1
  77. data/tools/limitsmonitor/CanvasdotWidget-7H5Hvcn--72788fd7d3e5915b297c.js +0 -1
  78. data/tools/limitsmonitor/CanvasimageWidget-BbWYx6Gj-c0c36bee214f5bfdc4de.js +0 -1
  79. data/tools/limitsmonitor/CanvasimagevalueWidget-Blvoe2X4-543f5bba4f1238823190.js +0 -1
  80. data/tools/limitsmonitor/CanvaslabelWidget-BPx_Rm4o-7745db37bca6dee5d238.js +0 -1
  81. data/tools/limitsmonitor/CanvaslabelvalueWidget-DzdWvL0W-4cf7b2a1d8a89fcab972.js +0 -1
  82. data/tools/limitsmonitor/CanvaslineWidget-CqskilGk-eb9c5049c4d025bf0538.js +0 -1
  83. data/tools/limitsmonitor/CanvaslinevalueWidget-C0JIKdvZ-ea5406a829856da1b461.js +0 -1
  84. data/tools/limitsmonitor/CheckbuttonWidget-C9FbJx2v-5408cffd80d02ff1d8f4.js +0 -1
  85. data/tools/limitsmonitor/ComboboxWidget-BbNKT0s8-d29e533b3adae306567f.js +0 -1
  86. data/tools/limitsmonitor/DateWidget-CBMsdRUE-faa2791fd6e673cefd61.js +0 -1
  87. data/tools/limitsmonitor/DetailsDialog-DRVahE5z-5bffe02b15c2f9293811.js +0 -1
  88. data/tools/limitsmonitor/DynamicWidget-CfMtj7H8-4447140b6f31aba6aa5b.js +0 -1
  89. data/tools/limitsmonitor/FormatvalueWidget-BLWsqhIZ-f36530b9f41f21d0cda6.js +0 -1
  90. data/tools/limitsmonitor/Graph-BiU56Qj2-63e90d160a75f5d89206.js +0 -1
  91. data/tools/limitsmonitor/GraphWidget-Ga0AEfrJ-59925e65c6f97fdac462.js +0 -1
  92. data/tools/limitsmonitor/HorizontalWidget-CsVhLwZO-a5e1517f3a23b4c73a05.js +0 -1
  93. data/tools/limitsmonitor/HorizontalboxWidget-xC6PADl3-3a6bd6770f5c70369918.js +0 -1
  94. data/tools/limitsmonitor/HorizontallineWidget-NZIxmRVN-270871e30b8dfc92c972.js +0 -1
  95. data/tools/limitsmonitor/IframeWidget-BgzjSfag-12b442d38a22add74a3b.js +0 -1
  96. data/tools/limitsmonitor/ImageLoader-DbFVK1Ui-131cd6bd79766afa7dc3.js +0 -1
  97. data/tools/limitsmonitor/ImageviewerWidget-BnT5m-nw-80a64449b740564b3730.js +0 -1
  98. data/tools/limitsmonitor/LabelWidget-DSDYmz6X-22cab93d8d2efa39351b.js +0 -1
  99. data/tools/limitsmonitor/LabelledWidget-DMb-myxs-7d384ea54cc6df4ed9db.js +0 -1
  100. data/tools/limitsmonitor/LabelprogressbarWidget-CkjDJBao-d70d5b8c57467f11f595.js +0 -1
  101. data/tools/limitsmonitor/LabelsparklineWidget-DBYPFz3Y-1c4aca8b705bffd6d821.js +0 -1
  102. data/tools/limitsmonitor/LabelvalueWidget-DlTkJC4i-298c5d8a16ca150e39d1.js +0 -1
  103. data/tools/limitsmonitor/LabelvaluedescWidget-dRqnGZub-9e4b54b7536384edaaf2.js +0 -1
  104. data/tools/limitsmonitor/LabelvaluelimitsbarWidget-CS4NAPJ1-c3631956817cb83dec56.js +0 -1
  105. data/tools/limitsmonitor/LabelvaluelimitscolumnWidget-D9x4Ppv8-67023f6d87d2f9349268.js +0 -1
  106. data/tools/limitsmonitor/LabelvaluerangebarWidget-Dhyng4-n-b1ac8d2088dde9c9a7e5.js +0 -1
  107. data/tools/limitsmonitor/Layout-mWR35VAD-12347d9cb0aec5695d99.js +0 -1
  108. data/tools/limitsmonitor/LedWidget-D8cq4pUv-5640f836eb08292ca1a6.js +0 -1
  109. data/tools/limitsmonitor/LimitsbarWidget-VGJnDuVM-e0be00ce5b4e50707d37.js +0 -1
  110. data/tools/limitsmonitor/LimitscolorWidget-CG6Pqi12-5179a058e78212ffe602.js +0 -1
  111. data/tools/limitsmonitor/LimitscolumnWidget-DjovQdiT-52005a64fc869222570b.js +0 -1
  112. data/tools/limitsmonitor/LinegraphWidget-DSWAhXgZ-56b3a0906ddde2f60b2a.js +0 -1
  113. data/tools/limitsmonitor/MatrixbycolumnsWidget-C3cuhRxz-5faecb02b20446620c49.js +0 -1
  114. data/tools/limitsmonitor/ProgressbarWidget-oCgAEFBO-5ccedb4ec742782b293e.js +0 -1
  115. data/tools/limitsmonitor/RadiobuttonWidget-D4Dak3lc-56388898c1388c0b4da5.js +0 -1
  116. data/tools/limitsmonitor/RadiogroupWidget-Dbe9T4fp-5e33a16476d53d7d7801.js +0 -1
  117. data/tools/limitsmonitor/RangebarWidget-CIVrgqrW-73d561d4cfc4372daa08.js +0 -1
  118. data/tools/limitsmonitor/RollupWidget-CH1-XNLV-fd531ebfef69e96862c1.js +0 -1
  119. data/tools/limitsmonitor/ScrollwindowWidget-BwFG6Wn8-79afbfdb201a7c89cacf.js +0 -1
  120. data/tools/limitsmonitor/SignalWidget-Gz2gHrUm-1beaaa0a5f3418f41e18.js +0 -1
  121. data/tools/limitsmonitor/SpacerWidget-Bg7VDB0k-a9d245a8d3dcc50a7413.js +0 -1
  122. data/tools/limitsmonitor/SparklineWidget-D_b5rfJv-f0d90d27432aee0f82da.js +0 -1
  123. data/tools/limitsmonitor/TabbookWidget-C30f9B6z-774cbad19f175472702b.js +0 -1
  124. data/tools/limitsmonitor/TextboxWidget-CDqxsgys-a9c863f537a70b2b3437.js +0 -1
  125. data/tools/limitsmonitor/TextfieldWidget-CAyjKJs6-ddf111b0955964122f64.js +0 -1
  126. data/tools/limitsmonitor/TimeWidget-BQsP0G2X-abe16efce257ade44564.js +0 -1
  127. data/tools/limitsmonitor/TitleWidget-DXVba53S-e168a97d113b20e9b815.js +0 -1
  128. data/tools/limitsmonitor/VWidget-CFTCukCL-6a12c4d5fcc0d3b4ade3.js +0 -1
  129. data/tools/limitsmonitor/ValueWidget-B-TWLPdM-2166bc1befd7fef66585.js +0 -1
  130. data/tools/limitsmonitor/ValuelimitsbarWidget-jsDXdPdC-d1b7f776663722797305.js +0 -1
  131. data/tools/limitsmonitor/ValuelimitscolumnWidget-I-uwnXM2-c8c89597dbf1dce4862d.js +0 -1
  132. data/tools/limitsmonitor/ValuerangebarWidget-OyhSTScu-633f76b325a10bc8aeda.js +0 -1
  133. data/tools/limitsmonitor/VerticalWidget-CkFbX1Gq-87a7a666526f68ec31d0.js +0 -1
  134. data/tools/limitsmonitor/VerticalboxWidget-FEQgPM9r-5309b1d81b0d45701f85.js +0 -1
  135. data/tools/limitsmonitor/Widget-C3-TBgP7-67b8bd3fd0861f456f70.js +0 -1
  136. data/tools/limitsmonitor/main-788a088d69870dd34b9a.js +0 -1502
@@ -1,8 +1,8 @@
1
- System.register(["./main-788a088d69870dd34b9a.js","vue","single-spa","./VWidget-CFTCukCL-6a12c4d5fcc0d3b4ade3.js","./ValueWidget-B-TWLPdM-2166bc1befd7fef66585.js","./IframeWidget-BgzjSfag-12b442d38a22add74a3b.js","./ValuelimitsbarWidget-jsDXdPdC-d1b7f776663722797305.js","vue-router","vuex","vuetify","./Widget-C3-TBgP7-67b8bd3fd0861f456f70.js","./DetailsDialog-DRVahE5z-5bffe02b15c2f9293811.js","./LimitsbarWidget-VGJnDuVM-e0be00ce5b4e50707d37.js","./BarColumn-Cflh9pUz-72d77005b1381ec6b473.js"],function(vs,ki){"use strict";var lt,_e,Be,ut,dt,ht,y,P,k,ft,g,m,F,H,z,G,re,j,ye,we,Y,$e,qe,pt,mt;return{setters:[C=>{lt=C.d,_e=C._,Be=C.R,ut=C.a,dt=C.f,ht=C.u},C=>{y=C.resolveComponent,P=C.createBlock,k=C.openBlock,ft=C.Teleport,g=C.createVNode,m=C.withCtx,F=C.createElementVNode,H=C.toDisplayString,z=C.createElementBlock,G=C.Fragment,re=C.renderList,j=C.createTextVNode,ye=C.mergeProps,we=C.createSlots,Y=C.createCommentVNode,$e=C.normalizeStyle,qe=C.normalizeClass},null,null,C=>{pt=C.default},null,C=>{mt=C.default},null,null,null,null,null,null,null],execute:function(){var C=document.createElement("style");C.textContent=`.footer[data-v-ed7ec5ac]{padding-top:5px}.v-input[data-v-ed7ec5ac]{background-color:var(--color-background-base-default)}.textfield-green[data-v-ed7ec5ac]{color:#00c800}.textfield-yellow[data-v-ed7ec5ac]{color:#ffdc00}.textfield-red[data-v-ed7ec5ac]{color:#ff2d2d}.limits-table[data-v-ed7ec5ac]{margin-top:5px;margin-bottom:10px}.limits-table[data-v-ed7ec5ac] th{font-weight:700;background-color:var(--color-background-base-default)}.card-height[data-v-3c276116]{height:calc(100vh - 150px)}
2
- /*$vite$:1*/`,document.head.appendChild(C);const Ss={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}},Es={class:"app-title mr-2"};function xs(t,e,s,r,n,i){const o=y("v-col"),a=y("v-row"),l=y("v-icon"),u=y("v-btn"),d=y("v-divider"),h=y("v-list-item-title"),b=y("v-list-item"),f=y("v-list"),w=y("v-menu"),p=y("v-radio"),I=y("v-list-item-action"),R=y("v-radio-group"),E=y("v-checkbox");return k(),P(ft,{to:"#openc3-menu"},[g(a,{"no-gutters":""},{default:m(()=>[g(o,{"align-self":"end"},{default:m(()=>[F("span",Es,H(s.title),1)]),_:1})]),_:1}),g(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(k(!0),z(G,null,re(s.menus,(O,V)=>(k(),P(w,{ref_for:!0,ref:"topmenu",key:V},{activator:m(({props:_})=>[g(u,ye({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:O.label,"data-test":i.formatDT(`${s.title} ${O.label}`)}),{append:m(()=>[g(l,{class:"menu-button-icon"},{default:m(()=>e[0]||(e[0]=[j(" mdi-menu-down ",-1)])),_:1,__:[0]})]),_:2},1040,["text","data-test"])]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),z(G,null,re(O.items,(_,N)=>(k(),z(G,null,[_.divider?(k(),P(d,{key:N+"-divider"})):_.subMenu&&_.subMenu.length>0?(k(),z("div",{key:N+"-submenu"},[(k(),P(w,{"open-on-hover":"",location:"right",key:N},{activator:m(({props:T})=>[(k(),P(b,ye({ref_for:!0},T,{disabled:_.disabled,key:N}),we({append:m(()=>[g(l,null,{default:m(()=>e[1]||(e[1]=[j(" mdi-chevron-right ",-1)])),_:1,__:[1]})]),default:m(()=>[!_.radio&&!_.checkbox?(k(),P(h,{key:0,style:$e("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[j(H(_.label),1)]),_:2},1032,["style"])):Y("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{disabled:_.disabled},{default:m(()=>[j(H(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),z(G,null,re(_.subMenu,(T,x)=>(k(),P(b,{key:x,"prepend-icon":T.icon,onClick:L=>i.subMenuClick(T)},{default:m(()=>[g(h,null,{default:m(()=>[j(H(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(k(),P(R,{"model-value":_.value,"onUpdate:modelValue":_.command,key:N+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:m(()=>[(k(!0),z(G,null,re(_.choices,(T,x)=>(k(),P(b,{key:x+"-choice"},{default:m(()=>[g(I,{class:"list-action"},{default:m(()=>[g(p,{color:"secondary",label:T.label,value:T.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(k(),P(b,{onClick:T=>_.command(_),disabled:_.disabled,"data-test":i.formatDT(`${s.title} ${O.label} ${_.label}`),key:N+"-list"},we({default:m(()=>[_.checkbox?(k(),P(I,{key:0,class:"list-action"},{default:m(()=>[g(E,{modelValue:_.checked,"onUpdate:modelValue":T=>_.checked=T,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):Y("",!0),!_.radio&&!_.checkbox?(k(),P(h,{key:1,style:$e("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[j(H(_.label),1)]),_:2},1032,["style"])):Y("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Cs=lt(Ss,[["render",xs],["__scopeId","data-v-4d454b93"]]);var Os=Object.defineProperty,ks=(t,e,s)=>e in t?Os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,ve=(t,e,s)=>ks(t,typeof e!="symbol"?e+"":e,s);function gt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Rs}=Object.prototype,{getPrototypeOf:Ve}=Object,{iterator:Se,toStringTag:bt}=Symbol,Ee=(t=>e=>{const s=Rs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),M=t=>(t=t.toLowerCase(),e=>Ee(e)===t),xe=t=>e=>typeof e===t,{isArray:ne}=Array,ce=xe("undefined");function le(t){return t!==null&&!ce(t)&&t.constructor!==null&&!ce(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const _t=M("ArrayBuffer");function Is(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&_t(t.buffer),e}const As=xe("string"),B=xe("function"),yt=xe("number"),ue=t=>t!==null&&typeof t=="object",Ts=t=>t===!0||t===!1,Ce=t=>{if(Ee(t)!=="object")return!1;const e=Ve(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(bt in t)&&!(Se in t)},Ls=t=>{if(!ue(t)||le(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Ps=M("Date"),js=M("File"),Ns=M("Blob"),Ds=M("FileList"),Us=t=>ue(t)&&B(t.pipe),Fs=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||B(t.append)&&((e=Ee(t))==="formdata"||e==="object"&&B(t.toString)&&t.toString()==="[object FormData]"))},Bs=M("URLSearchParams"),[$s,qs,Vs,zs]=["ReadableStream","Request","Response","Headers"].map(M),Ms=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function de(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let r,n;if(typeof t!="object"&&(t=[t]),ne(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{if(le(t))return;const i=s?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,t[a],a,t)}}function wt(t,e){if(le(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 Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vt=t=>!ce(t)&&t!==Z;function ze(){const{caseless:t}=vt(this)&&this||{},e={},s=(r,n)=>{const i=t&&wt(e,n)||n;Ce(e[i])&&Ce(r)?e[i]=ze(e[i],r):Ce(r)?e[i]=ze({},r):ne(r)?e[i]=r.slice():e[i]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&de(arguments[r],s);return e}const Ws=(t,e,s,{allOwnKeys:r}={})=>(de(e,(n,i)=>{s&&B(n)?t[i]=gt(n,s):t[i]=n},{allOwnKeys:r}),t),Js=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hs=(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)},Ks=(t,e,s,r)=>{let n,i,o;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)o=n[i],(!r||r(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=s!==!1&&Ve(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Gs=(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},Ys=t=>{if(!t)return null;if(ne(t))return t;let e=t.length;if(!yt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Zs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ve(Uint8Array)),Xs=(t,e)=>{const s=(t&&t[Se]).call(t);let r;for(;(r=s.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},Qs=(t,e)=>{let s;const r=[];for(;(s=t.exec(e))!==null;)r.push(s);return r},er=M("HTMLFormElement"),tr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,r){return s.toUpperCase()+r}),St=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),sr=M("RegExp"),Et=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),r={};de(s,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(r[i]=o||n)}),Object.defineProperties(t,r)},rr=t=>{Et(t,(e,s)=>{if(B(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const r=t[s];if(B(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+"'")})}})},nr=(t,e)=>{const s={},r=n=>{n.forEach(i=>{s[i]=!0})};return ne(t)?r(t):r(String(t).split(e)),s},ir=()=>{},or=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ar(t){return!!(t&&B(t.append)&&t[bt]==="FormData"&&t[Se])}const cr=t=>{const e=new Array(10),s=(r,n)=>{if(ue(r)){if(e.indexOf(r)>=0)return;if(le(r))return r;if(!("toJSON"in r)){e[n]=r;const i=ne(r)?[]:{};return de(r,(o,a)=>{const l=s(o,n+1);!ce(l)&&(i[a]=l)}),e[n]=void 0,i}}return r};return s(t,0)},lr=M("AsyncFunction"),ur=t=>t&&(ue(t)||B(t))&&B(t.then)&&B(t.catch),xt=((t,e)=>t?setImmediate:e?((s,r)=>(Z.addEventListener("message",({source:n,data:i})=>{n===Z&&i===s&&r.length&&r.shift()()},!1),n=>{r.push(n),Z.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",B(Z.postMessage)),dr=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||xt,hr=t=>t!=null&&B(t[Se]),c={isArray:ne,isArrayBuffer:_t,isBuffer:le,isFormData:Fs,isArrayBufferView:Is,isString:As,isNumber:yt,isBoolean:Ts,isObject:ue,isPlainObject:Ce,isEmptyObject:Ls,isReadableStream:$s,isRequest:qs,isResponse:Vs,isHeaders:zs,isUndefined:ce,isDate:Ps,isFile:js,isBlob:Ns,isRegExp:sr,isFunction:B,isStream:Us,isURLSearchParams:Bs,isTypedArray:Zs,isFileList:Ds,forEach:de,merge:ze,extend:Ws,trim:Ms,stripBOM:Js,inherits:Hs,toFlatObject:Ks,kindOf:Ee,kindOfTest:M,endsWith:Gs,toArray:Ys,forEachEntry:Xs,matchAll:Qs,isHTMLForm:er,hasOwnProperty:St,hasOwnProp:St,reduceDescriptors:Et,freezeMethods:rr,toObjectSet:nr,toCamelCase:tr,noop:ir,toFiniteNumber:or,findKey:wt,global:Z,isContextDefined:vt,isSpecCompliantForm:ar,toJSONObject:cr,isAsyncFn:lr,isThenable:ur,setImmediate:xt,asap:dr,isIterable:hr};function v(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(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const Ct=v.prototype,Ot={};["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=>{Ot[t]={value:t}}),Object.defineProperties(v,Ot),Object.defineProperty(Ct,"isAxiosError",{value:!0}),v.from=(t,e,s,r,n,i)=>{const o=Object.create(Ct);return c.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(o,t.message,e,s,r,n),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const fr=null;function Me(t){return c.isPlainObject(t)||c.isArray(t)}function kt(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function Rt(t,e,s){return t?t.concat(e).map(function(r,n){return r=kt(r),!s&&n?"["+r+"]":r}).join(s?".":""):e}function pr(t){return c.isArray(t)&&!t.some(Me)}const mr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Oe(t,e,s){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=c.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,w){return!c.isUndefined(w[f])});const r=s.metaTokens,n=s.visitor||u,i=s.dots,o=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 v("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,w,p){let I=f;if(f&&!p&&typeof f=="object"){if(c.endsWith(w,"{}"))w=r?w:w.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&pr(f)||(c.isFileList(f)||c.endsWith(w,"[]"))&&(I=c.toArray(f)))return w=kt(w),I.forEach(function(R,E){!(c.isUndefined(R)||R===null)&&e.append(o===!0?Rt([w],E,i):o===null?w:w+"[]",l(R))}),!1}return Me(f)?!0:(e.append(Rt(p,w,i),l(f)),!1)}const d=[],h=Object.assign(mr,{defaultVisitor:u,convertValue:l,isVisitable:Me});function b(f,w){if(!c.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(f),c.forEach(f,function(p,I){(!(c.isUndefined(p)||p===null)&&n.call(e,p,c.isString(I)?I.trim():I,w,h))===!0&&b(p,w?w.concat(I):[I])}),d.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return b(t),e}function It(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function We(t,e){this._pairs=[],t&&Oe(t,this,e)}const At=We.prototype;At.append=function(t,e){this._pairs.push([t,e])},At.toString=function(t){const e=t?function(s){return t.call(this,s,It)}:It;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function gr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tt(t,e,s){if(!e)return t;const r=s&&s.encode||gr;c.isFunction(s)&&(s={serialize:s});const n=s&&s.serialize;let i;if(n?i=n(e,s):i=c.isURLSearchParams(e)?e.toString():new We(e,s).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Lt{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 Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},br=typeof URLSearchParams<"u"?URLSearchParams:We,_r=typeof FormData<"u"?FormData:null,yr=typeof Blob<"u"?Blob:null,wr={isBrowser:!0,classes:{URLSearchParams:br,FormData:_r,Blob:yr},protocols:["http","https","file","blob","url","data"]},Je=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,vr=Je&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),Sr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Er=Je&&window.location.href||"http://localhost",xr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Je,hasStandardBrowserEnv:vr,hasStandardBrowserWebWorkerEnv:Sr,navigator:He,origin:Er},Symbol.toStringTag,{value:"Module"})),U={...xr,...wr};function Cr(t,e){return Oe(t,new U.classes.URLSearchParams,{visitor:function(s,r,n,i){return U.isNode&&c.isBuffer(s)?(this.append(r,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Or(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function kr(t){const e={},s=Object.keys(t);let r;const n=s.length;let i;for(r=0;r<n;r++)i=s[r],e[i]=t[i];return e}function jt(t){function e(s,r,n,i){let o=s[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=s.length;return o=!o&&c.isArray(n)?n.length:o,l?(c.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a):((!n[o]||!c.isObject(n[o]))&&(n[o]=[]),e(s,r,n[o],i)&&c.isArray(n[o])&&(n[o]=kr(n[o])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const s={};return c.forEachEntry(t,(r,n)=>{e(Or(r),n,s,0)}),s}return null}function Rr(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 he={transitional:Pt,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(jt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Cr(t,this.formSerializer).toString();if((i=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Oe(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return n||r?(e.setContentType("application/json",!1),Rr(t)):t}],transformResponse:[function(t){const e=this.transitional||he.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)}catch(i){if(n)throw i.name==="SyntaxError"?v.from(i,v.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{he.headers[t]={}});const Ir=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"]),Ar=t=>{const e={};let s,r,n;return t&&t.split(`
3
- `).forEach(function(i){n=i.indexOf(":"),s=i.substring(0,n).trim().toLowerCase(),r=i.substring(n+1).trim(),!(!s||e[s]&&Ir[s])&&(s==="set-cookie"?e[s]?e[s].push(r):e[s]=[r]:e[s]=e[s]?e[s]+", "+r:r)}),e},Nt=Symbol("internals");function fe(t){return t&&String(t).trim().toLowerCase()}function ke(t){return t===!1||t==null?t:c.isArray(t)?t.map(ke):String(t)}function Tr(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 Lr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ke(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 Pr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,r)=>s.toUpperCase()+r)}function jr(t,e){const s=c.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+s,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,e,s){const r=this;function n(o,a,l){const u=fe(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]=ke(o))}const i=(o,a)=>c.forEach(o,(l,u)=>n(l,u,a));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(c.isString(t)&&(t=t.trim())&&!Lr(t))i(Ar(t),e);else if(c.isObject(t)&&c.isIterable(t)){let o={},a,l;for(const u of t){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(a=o[l])?c.isArray(a)?[...a,u[1]]:[a,u[1]]:u[1]}i(o,e)}else t!=null&&n(e,t,s);return this}get(t,e){if(t=fe(t),t){const s=c.findKey(this,t);if(s){const r=this[s];if(!e)return r;if(e===!0)return Tr(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=fe(t),t){const s=c.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Ke(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let r=!1;function n(i){if(i=fe(i),i){const o=c.findKey(s,i);o&&(!e||Ke(s,s[o],o,e))&&(delete s[o],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||Ke(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 i=c.findKey(s,n);if(i){e[i]=ke(r),delete e[n];return}const o=t?Pr(n):String(n).trim();o!==n&&delete e[n],e[o]=ke(r),s[o]=!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[Nt]=this[Nt]={accessors:{}}).accessors,s=this.prototype;function r(n){const i=fe(n);e[i]||(jr(s,n),e[i]=!0)}return c.isArray(t)?t.forEach(r):r(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors($.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[s]=r}}}),c.freezeMethods($);function Ge(t,e){const s=this||he,r=e||s,n=$.from(r.headers);let i=r.data;return c.forEach(t,function(o){i=o.call(s,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function Dt(t){return!!(t&&t.__CANCEL__)}function ie(t,e,s){v.call(this,t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(ie,v,{__CANCEL__:!0});function Ut(t,e,s){const r=s.config.validateStatus;!s.status||!r||r(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Nr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Dr(t,e){t=t||10;const s=new Array(t),r=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),u=r[i];o||(o=l),s[n]=a,r[n]=l;let d=i,h=0;for(;d!==n;)h+=s[d++],d=d%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),l-o<e)return;const b=u&&l-u;return b?Math.round(h*1e3/b):void 0}}function Ur(t,e){let s=0,r=1e3/e,n,i;const o=(a,l=Date.now())=>{s=l,n=null,i&&(clearTimeout(i),i=null),t(...a)};return[(...a)=>{const l=Date.now(),u=l-s;u>=r?o(a,l):(n=a,i||(i=setTimeout(()=>{i=null,o(n)},r-u)))},()=>n&&o(n)]}const Re=(t,e,s=3)=>{let r=0;const n=Dr(50,250);return Ur(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-r,u=n(l),d=o<=a;r=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},s)},Ft=(t,e)=>{const s=t!=null;return[r=>e[0]({lengthComputable:s,total:t,loaded:r}),e[1]]},Bt=t=>(...e)=>c.asap(()=>t(...e)),Fr=U.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,U.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,Br=U.hasStandardBrowserEnv?{write(t,e,s,r,n,i){const o=[t+"="+encodeURIComponent(e)];c.isNumber(s)&&o.push("expires="+new Date(s).toGMTString()),c.isString(r)&&o.push("path="+r),c.isString(n)&&o.push("domain="+n),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $r(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $t(t,e,s){let r=!$r(e);return t&&(r||s==!1)?qr(t,e):e}const qt=t=>t instanceof $?{...t}:t;function X(t,e){e=e||{};const s={};function r(u,d,h,b){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:b},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function n(u,d,h,b){if(c.isUndefined(d)){if(!c.isUndefined(u))return r(void 0,u,h,b)}else return r(u,d,h,b)}function i(u,d){if(!c.isUndefined(d))return r(void 0,d)}function o(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:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d,h)=>n(qt(u),qt(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 Vt=t=>{const e=X({},t);let{data:s,withXSRFToken:r,xsrfHeaderName:n,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=$.from(o),e.url=Tt($t(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(c.isFormData(s)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(U.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(e)),r||r!==!1&&Fr(e.url))){const u=n&&i&&Br.read(i);u&&o.set(n,u)}return e},Vr=typeof XMLHttpRequest<"u",zr=Vr&&function(t){return new Promise(function(e,s){const r=Vt(t);let n=r.data;const i=$.from(r.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=r,u,d,h,b,f;function w(){b&&b(),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 I(){if(!p)return;const E=$.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:E,config:t,request:p};Ut(function(V){e(V),w()},function(V){s(V),w()},O),p=null}"onloadend"in p?p.onloadend=I:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(I)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(){s(new v("Network Error",v.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const O=r.transitional||Pt;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),s(new v(E,O.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},n===void 0&&i.setContentType(null),"setRequestHeader"in p&&c.forEach(i.toJSON(),function(E,O){p.setRequestHeader(O,E)}),c.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),o&&o!=="json"&&(p.responseType=r.responseType),l&&([h,f]=Re(l,!0),p.addEventListener("progress",h)),a&&p.upload&&([d,b]=Re(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(r.cancelToken||r.signal)&&(u=E=>{p&&(s(!E||E.type?new ie(null,t,p):E),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const R=Nr(r.url);if(R&&U.protocols.indexOf(R)===-1){s(new v("Unsupported protocol "+R+":",v.ERR_BAD_REQUEST,t));return}p.send(n||null)})},Mr=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let r=new AbortController,n;const i=function(u){if(!n){n=!0,a();const d=u instanceof Error?u:this.reason;r.abort(d instanceof v?d:new ie(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>c.asap(a),l}},Wr=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},Jr=async function*(t,e){for await(const s of Hr(t))yield*Wr(s,e)},Hr=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()}},zt=(t,e,s,r)=>{const n=Jr(t,e);let i=0,o,a=l=>{o||(o=!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 b=i+=h;s(b)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},Ie=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Mt=Ie&&typeof ReadableStream=="function",Kr=Ie&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Wt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Gr=Mt&&Wt(()=>{let t=!1;const e=new Request(U.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Jt=64*1024,Ye=Mt&&Wt(()=>c.isReadableStream(new Response("").body)),Ae={stream:Ye&&(t=>t.body)};Ie&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ae[e]&&(Ae[e]=c.isFunction(t[e])?s=>s[e]():(s,r)=>{throw new v(`Response type '${e}' is not supported`,v.ERR_NOT_SUPPORT,r)})})})(new Response);const Yr=async t=>{if(t==null)return 0;if(c.isBlob(t))return t.size;if(c.isSpecCompliantForm(t))return(await new Request(U.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(c.isArrayBufferView(t)||c.isArrayBuffer(t))return t.byteLength;if(c.isURLSearchParams(t)&&(t=t+""),c.isString(t))return(await Kr(t)).byteLength},Zr=async(t,e)=>c.toFiniteNumber(t.getContentLength())??Yr(e),Xr=Ie&&(async t=>{let{url:e,method:s,data:r,signal:n,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:b}=Vt(t);u=u?(u+"").toLowerCase():"text";let f=Mr([n,i&&i.toAbortSignal()],o),w;const p=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let I;try{if(l&&Gr&&s!=="get"&&s!=="head"&&(I=await Zr(d,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),N;if(c.isFormData(r)&&(N=_.headers.get("content-type"))&&d.setContentType(N),_.body){const[T,x]=Ft(I,Re(Bt(l)));r=zt(_.body,Jt,T,x)}}c.isString(h)||(h=h?"include":"omit");const R="credentials"in Request.prototype;w=new Request(e,{...b,signal:f,method:s.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:R?h:void 0});let E=await fetch(w,b);const O=Ye&&(u==="stream"||u==="response");if(Ye&&(a||O&&p)){const _={};["status","statusText","headers"].forEach(L=>{_[L]=E[L]});const N=c.toFiniteNumber(E.headers.get("content-length")),[T,x]=a&&Ft(N,Re(Bt(a),!0))||[];E=new Response(zt(E.body,Jt,T,()=>{x&&x(),p&&p()}),_)}u=u||"text";let V=await Ae[c.findKey(Ae,u)||"text"](E,t);return!O&&p&&p(),await new Promise((_,N)=>{Ut(_,N,{data:V,headers:$.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:w})})}catch(R){throw p&&p(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,t,w),{cause:R.cause||R}):v.from(R,R&&R.code,t,w)}}),Ze={http:fr,xhr:zr,fetch:Xr};c.forEach(Ze,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ht=t=>`- ${t}`,Qr=t=>c.isFunction(t)||t===null||t===!1,Kt={getAdapter:t=>{t=c.isArray(t)?t:[t];const{length:e}=t;let s,r;const n={};for(let i=0;i<e;i++){s=t[i];let o;if(r=s,!Qr(s)&&(r=Ze[(o=String(s)).toLowerCase()],r===void 0))throw new v(`Unknown adapter '${o}'`);if(r)break;n[o||"#"+i]=r}if(!r){const i=Object.entries(n).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
1
+ System.register(["./main-4ea7df8746eb0bc0fbc8.js","vue","single-spa","./ValueWidget-BvT1ASar-9c1637b35b4543df3eec.js","./IframeWidget-BgJCgues-66ddc95ffc3b2b136951.js","./ValuelimitsbarWidget-C5lBnUmB-c71fd8149317d9bceda1.js","vue-router","vuex","vuetify","./DetailsDialog-CLKEfU0s-9a7b4535747d1b9bf6ca.js","./VWidget-CoIgX3hM-ed969512a423fe7d5562.js","./Widget-B8t93Oid-cdbbb47eb4c635a756f1.js","./LimitsbarWidget-D1U6SvVL-ebcbade450042d3f5a24.js","./BarColumn-BWJ0Dd4O-f81952b47d4ae7a2ae18.js"],(function(vs,ki){"use strict";var lt,ye,Be,ut,dt,ht,y,N,k,ft,g,m,F,H,M,Y,re,P,we,ve,Z,$e,qe,pt,mt;return{setters:[C=>{lt=C.d,ye=C._,Be=C.R,ut=C.T,dt=C.A,ht=C.U},C=>{y=C.resolveComponent,N=C.createBlock,k=C.openBlock,ft=C.Teleport,g=C.createVNode,m=C.withCtx,F=C.createElementVNode,H=C.toDisplayString,M=C.createElementBlock,Y=C.Fragment,re=C.renderList,P=C.createTextVNode,we=C.mergeProps,ve=C.createSlots,Z=C.createCommentVNode,$e=C.normalizeStyle,qe=C.normalizeClass},null,C=>{pt=C.default},null,C=>{mt=C.default},null,null,null,null,null,null,null,null],execute:(function(){var C=document.createElement("style");C.textContent=`.footer[data-v-ed7ec5ac]{padding-top:5px}.v-input[data-v-ed7ec5ac]{background-color:var(--color-background-base-default)}.textfield-green[data-v-ed7ec5ac]{color:#00c800}.textfield-yellow[data-v-ed7ec5ac]{color:#ffdc00}.textfield-red[data-v-ed7ec5ac]{color:#ff2d2d}.limits-table[data-v-ed7ec5ac]{margin-top:5px;margin-bottom:10px}.limits-table[data-v-ed7ec5ac] th{font-weight:700;background-color:var(--color-background-base-default)}.card-height[data-v-3c276116]{height:calc(100vh - 150px)}
2
+ /*$vite$:1*/`,document.head.appendChild(C);const Ss={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}},Es={class:"app-title mr-2"};function xs(t,e,s,r,n,i){const o=y("v-col"),a=y("v-row"),l=y("v-icon"),u=y("v-btn"),d=y("v-divider"),h=y("v-list-item-title"),b=y("v-list-item"),f=y("v-list"),w=y("v-menu"),p=y("v-radio"),I=y("v-list-item-action"),R=y("v-radio-group"),E=y("v-checkbox");return k(),N(ft,{to:"#openc3-menu"},[g(a,{"no-gutters":""},{default:m(()=>[g(o,{"align-self":"end"},{default:m(()=>[F("span",Es,H(s.title),1)]),_:1})]),_:1}),g(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(k(!0),M(Y,null,re(s.menus,(O,V)=>(k(),N(w,{ref_for:!0,ref:"topmenu",key:V},{activator:m(({props:_})=>[g(u,we({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:O.label,"data-test":i.formatDT(`${s.title} ${O.label}`)}),{append:m(()=>[g(l,{class:"menu-button-icon"},{default:m(()=>[...e[0]||(e[0]=[P(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),M(Y,null,re(O.items,(_,j)=>(k(),M(Y,null,[_.divider?(k(),N(d,{key:j+"-divider"})):_.subMenu&&_.subMenu.length>0?(k(),M("div",{key:j+"-submenu"},[(k(),N(w,{"open-on-hover":"",location:"right",key:j},{activator:m(({props:T})=>[(k(),N(b,we({ref_for:!0},T,{disabled:_.disabled,key:j}),ve({append:m(()=>[g(l,null,{default:m(()=>[...e[1]||(e[1]=[P(" mdi-chevron-right ",-1)])]),_:1})]),default:m(()=>[!_.radio&&!_.checkbox?(k(),N(h,{key:0,style:$e("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[P(H(_.label),1)]),_:2},1032,["style"])):Z("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{disabled:_.disabled},{default:m(()=>[P(H(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:m(()=>[g(f,null,{default:m(()=>[(k(!0),M(Y,null,re(_.subMenu,(T,x)=>(k(),N(b,{key:x,"prepend-icon":T.icon,onClick:L=>i.subMenuClick(T)},{default:m(()=>[g(h,null,{default:m(()=>[P(H(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(k(),N(R,{"model-value":_.value,"onUpdate:modelValue":_.command,key:j+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:m(()=>[(k(!0),M(Y,null,re(_.choices,(T,x)=>(k(),N(b,{key:x+"-choice"},{default:m(()=>[g(I,{class:"list-action"},{default:m(()=>[g(p,{color:"secondary",label:T.label,value:T.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(k(),N(b,{onClick:T=>_.command(_),disabled:_.disabled,"data-test":i.formatDT(`${s.title} ${O.label} ${_.label}`),key:j+"-list"},ve({default:m(()=>[_.checkbox?(k(),N(I,{key:0,class:"list-action"},{default:m(()=>[g(E,{modelValue:_.checked,"onUpdate:modelValue":T=>_.checked=T,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):Z("",!0),!_.radio&&!_.checkbox?(k(),N(h,{key:1,style:$e("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[P(H(_.label),1)]),_:2},1032,["style"])):Z("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[g(l,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Cs=lt(Ss,[["render",xs],["__scopeId","data-v-4d454b93"]]);var Os=Object.defineProperty,ks=(t,e,s)=>e in t?Os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Se=(t,e,s)=>ks(t,typeof e!="symbol"?e+"":e,s);function gt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Rs}=Object.prototype,{getPrototypeOf:Ve}=Object,{iterator:Ee,toStringTag:bt}=Symbol,xe=(t=>e=>{const s=Rs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),z=t=>(t=t.toLowerCase(),e=>xe(e)===t),Ce=t=>e=>typeof e===t,{isArray:ne}=Array,ce=Ce("undefined");function le(t){return t!==null&&!ce(t)&&t.constructor!==null&&!ce(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const _t=z("ArrayBuffer");function Is(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&_t(t.buffer),e}const As=Ce("string"),B=Ce("function"),yt=Ce("number"),ue=t=>t!==null&&typeof t=="object",Ts=t=>t===!0||t===!1,Oe=t=>{if(xe(t)!=="object")return!1;const e=Ve(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(bt in t)&&!(Ee in t)},Ls=t=>{if(!ue(t)||le(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Ns=z("Date"),Ps=z("File"),js=z("Blob"),Us=z("FileList"),Ds=t=>ue(t)&&B(t.pipe),Fs=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||B(t.append)&&((e=xe(t))==="formdata"||e==="object"&&B(t.toString)&&t.toString()==="[object FormData]"))},Bs=z("URLSearchParams"),[$s,qs,Vs,Ms]=["ReadableStream","Request","Response","Headers"].map(z),zs=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function de(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let r,n;if(typeof t!="object"&&(t=[t]),ne(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{if(le(t))return;const i=s?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,t[a],a,t)}}function wt(t,e){if(le(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 G=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vt=t=>!ce(t)&&t!==G;function Me(){const{caseless:t}=vt(this)&&this||{},e={},s=(r,n)=>{const i=t&&wt(e,n)||n;Oe(e[i])&&Oe(r)?e[i]=Me(e[i],r):Oe(r)?e[i]=Me({},r):ne(r)?e[i]=r.slice():e[i]=r};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&de(arguments[r],s);return e}const Ws=(t,e,s,{allOwnKeys:r}={})=>(de(e,(n,i)=>{s&&B(n)?t[i]=gt(n,s):t[i]=n},{allOwnKeys:r}),t),Js=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Hs=(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)},Ks=(t,e,s,r)=>{let n,i,o;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)o=n[i],(!r||r(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=s!==!1&&Ve(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ys=(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},Zs=t=>{if(!t)return null;if(ne(t))return t;let e=t.length;if(!yt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Gs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ve(Uint8Array)),Xs=(t,e)=>{const s=(t&&t[Ee]).call(t);let r;for(;(r=s.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},Qs=(t,e)=>{let s;const r=[];for(;(s=t.exec(e))!==null;)r.push(s);return r},er=z("HTMLFormElement"),tr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,r){return s.toUpperCase()+r}),St=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),sr=z("RegExp"),Et=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),r={};de(s,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(r[i]=o||n)}),Object.defineProperties(t,r)},rr=t=>{Et(t,(e,s)=>{if(B(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const r=t[s];if(B(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+"'")})}})},nr=(t,e)=>{const s={},r=n=>{n.forEach(i=>{s[i]=!0})};return ne(t)?r(t):r(String(t).split(e)),s},ir=()=>{},or=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ar(t){return!!(t&&B(t.append)&&t[bt]==="FormData"&&t[Ee])}const cr=t=>{const e=new Array(10),s=(r,n)=>{if(ue(r)){if(e.indexOf(r)>=0)return;if(le(r))return r;if(!("toJSON"in r)){e[n]=r;const i=ne(r)?[]:{};return de(r,(o,a)=>{const l=s(o,n+1);!ce(l)&&(i[a]=l)}),e[n]=void 0,i}}return r};return s(t,0)},lr=z("AsyncFunction"),ur=t=>t&&(ue(t)||B(t))&&B(t.then)&&B(t.catch),xt=((t,e)=>t?setImmediate:e?((s,r)=>(G.addEventListener("message",({source:n,data:i})=>{n===G&&i===s&&r.length&&r.shift()()},!1),n=>{r.push(n),G.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",B(G.postMessage)),dr=typeof queueMicrotask<"u"?queueMicrotask.bind(G):typeof process<"u"&&process.nextTick||xt,hr=t=>t!=null&&B(t[Ee]),c={isArray:ne,isArrayBuffer:_t,isBuffer:le,isFormData:Fs,isArrayBufferView:Is,isString:As,isNumber:yt,isBoolean:Ts,isObject:ue,isPlainObject:Oe,isEmptyObject:Ls,isReadableStream:$s,isRequest:qs,isResponse:Vs,isHeaders:Ms,isUndefined:ce,isDate:Ns,isFile:Ps,isBlob:js,isRegExp:sr,isFunction:B,isStream:Ds,isURLSearchParams:Bs,isTypedArray:Gs,isFileList:Us,forEach:de,merge:Me,extend:Ws,trim:zs,stripBOM:Js,inherits:Hs,toFlatObject:Ks,kindOf:xe,kindOfTest:z,endsWith:Ys,toArray:Zs,forEachEntry:Xs,matchAll:Qs,isHTMLForm:er,hasOwnProperty:St,hasOwnProp:St,reduceDescriptors:Et,freezeMethods:rr,toObjectSet:nr,toCamelCase:tr,noop:ir,toFiniteNumber:or,findKey:wt,global:G,isContextDefined:vt,isSpecCompliantForm:ar,toJSONObject:cr,isAsyncFn:lr,isThenable:ur,setImmediate:xt,asap:dr,isIterable:hr};function v(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(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const Ct=v.prototype,Ot={};["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=>{Ot[t]={value:t}}),Object.defineProperties(v,Ot),Object.defineProperty(Ct,"isAxiosError",{value:!0}),v.from=(t,e,s,r,n,i)=>{const o=Object.create(Ct);return c.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(o,t.message,e,s,r,n),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const fr=null;function ze(t){return c.isPlainObject(t)||c.isArray(t)}function kt(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function Rt(t,e,s){return t?t.concat(e).map(function(r,n){return r=kt(r),!s&&n?"["+r+"]":r}).join(s?".":""):e}function pr(t){return c.isArray(t)&&!t.some(ze)}const mr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function ke(t,e,s){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=c.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,w){return!c.isUndefined(w[f])});const r=s.metaTokens,n=s.visitor||u,i=s.dots,o=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 v("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,w,p){let I=f;if(f&&!p&&typeof f=="object"){if(c.endsWith(w,"{}"))w=r?w:w.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&pr(f)||(c.isFileList(f)||c.endsWith(w,"[]"))&&(I=c.toArray(f)))return w=kt(w),I.forEach(function(R,E){!(c.isUndefined(R)||R===null)&&e.append(o===!0?Rt([w],E,i):o===null?w:w+"[]",l(R))}),!1}return ze(f)?!0:(e.append(Rt(p,w,i),l(f)),!1)}const d=[],h=Object.assign(mr,{defaultVisitor:u,convertValue:l,isVisitable:ze});function b(f,w){if(!c.isUndefined(f)){if(d.indexOf(f)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(f),c.forEach(f,function(p,I){(!(c.isUndefined(p)||p===null)&&n.call(e,p,c.isString(I)?I.trim():I,w,h))===!0&&b(p,w?w.concat(I):[I])}),d.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return b(t),e}function It(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function We(t,e){this._pairs=[],t&&ke(t,this,e)}const At=We.prototype;At.append=function(t,e){this._pairs.push([t,e])},At.toString=function(t){const e=t?function(s){return t.call(this,s,It)}:It;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function gr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tt(t,e,s){if(!e)return t;const r=s&&s.encode||gr;c.isFunction(s)&&(s={serialize:s});const n=s&&s.serialize;let i;if(n?i=n(e,s):i=c.isURLSearchParams(e)?e.toString():new We(e,s).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Lt{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 Nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},br=typeof URLSearchParams<"u"?URLSearchParams:We,_r=typeof FormData<"u"?FormData:null,yr=typeof Blob<"u"?Blob:null,wr={isBrowser:!0,classes:{URLSearchParams:br,FormData:_r,Blob:yr},protocols:["http","https","file","blob","url","data"]},Je=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,vr=Je&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),Sr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Er=Je&&window.location.href||"http://localhost",xr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Je,hasStandardBrowserEnv:vr,hasStandardBrowserWebWorkerEnv:Sr,navigator:He,origin:Er},Symbol.toStringTag,{value:"Module"})),D={...xr,...wr};function Cr(t,e){return ke(t,new D.classes.URLSearchParams,{visitor:function(s,r,n,i){return D.isNode&&c.isBuffer(s)?(this.append(r,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Or(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function kr(t){const e={},s=Object.keys(t);let r;const n=s.length;let i;for(r=0;r<n;r++)i=s[r],e[i]=t[i];return e}function Pt(t){function e(s,r,n,i){let o=s[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=i>=s.length;return o=!o&&c.isArray(n)?n.length:o,l?(c.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!a):((!n[o]||!c.isObject(n[o]))&&(n[o]=[]),e(s,r,n[o],i)&&c.isArray(n[o])&&(n[o]=kr(n[o])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const s={};return c.forEachEntry(t,(r,n)=>{e(Or(r),n,s,0)}),s}return null}function Rr(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 he={transitional:Nt,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(Pt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Cr(t,this.formSerializer).toString();if((i=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ke(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return n||r?(e.setContentType("application/json",!1),Rr(t)):t}],transformResponse:[function(t){const e=this.transitional||he.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)}catch(i){if(n)throw i.name==="SyntaxError"?v.from(i,v.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:D.classes.FormData,Blob:D.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{he.headers[t]={}});const Ir=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"]),Ar=t=>{const e={};let s,r,n;return t&&t.split(`
3
+ `).forEach(function(i){n=i.indexOf(":"),s=i.substring(0,n).trim().toLowerCase(),r=i.substring(n+1).trim(),!(!s||e[s]&&Ir[s])&&(s==="set-cookie"?e[s]?e[s].push(r):e[s]=[r]:e[s]=e[s]?e[s]+", "+r:r)}),e},jt=Symbol("internals");function fe(t){return t&&String(t).trim().toLowerCase()}function Re(t){return t===!1||t==null?t:c.isArray(t)?t.map(Re):String(t)}function Tr(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 Lr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ke(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 Nr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,r)=>s.toUpperCase()+r)}function Pr(t,e){const s=c.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+s,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,e,s){const r=this;function n(o,a,l){const u=fe(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]=Re(o))}const i=(o,a)=>c.forEach(o,(l,u)=>n(l,u,a));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(c.isString(t)&&(t=t.trim())&&!Lr(t))i(Ar(t),e);else if(c.isObject(t)&&c.isIterable(t)){let o={},a,l;for(const u of t){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(a=o[l])?c.isArray(a)?[...a,u[1]]:[a,u[1]]:u[1]}i(o,e)}else t!=null&&n(e,t,s);return this}get(t,e){if(t=fe(t),t){const s=c.findKey(this,t);if(s){const r=this[s];if(!e)return r;if(e===!0)return Tr(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=fe(t),t){const s=c.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Ke(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let r=!1;function n(i){if(i=fe(i),i){const o=c.findKey(s,i);o&&(!e||Ke(s,s[o],o,e))&&(delete s[o],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||Ke(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 i=c.findKey(s,n);if(i){e[i]=Re(r),delete e[n];return}const o=t?Nr(n):String(n).trim();o!==n&&delete e[n],e[o]=Re(r),s[o]=!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[jt]=this[jt]={accessors:{}}).accessors,s=this.prototype;function r(n){const i=fe(n);e[i]||(Pr(s,n),e[i]=!0)}return c.isArray(t)?t.forEach(r):r(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors($.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[s]=r}}}),c.freezeMethods($);function Ye(t,e){const s=this||he,r=e||s,n=$.from(r.headers);let i=r.data;return c.forEach(t,function(o){i=o.call(s,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function Ut(t){return!!(t&&t.__CANCEL__)}function ie(t,e,s){v.call(this,t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError"}c.inherits(ie,v,{__CANCEL__:!0});function Dt(t,e,s){const r=s.config.validateStatus;!s.status||!r||r(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function jr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ur(t,e){t=t||10;const s=new Array(t),r=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),u=r[i];o||(o=l),s[n]=a,r[n]=l;let d=i,h=0;for(;d!==n;)h+=s[d++],d=d%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),l-o<e)return;const b=u&&l-u;return b?Math.round(h*1e3/b):void 0}}function Dr(t,e){let s=0,r=1e3/e,n,i;const o=(a,l=Date.now())=>{s=l,n=null,i&&(clearTimeout(i),i=null),t(...a)};return[(...a)=>{const l=Date.now(),u=l-s;u>=r?o(a,l):(n=a,i||(i=setTimeout(()=>{i=null,o(n)},r-u)))},()=>n&&o(n)]}const Ie=(t,e,s=3)=>{let r=0;const n=Ur(50,250);return Dr(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-r,u=n(l),d=o<=a;r=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},s)},Ft=(t,e)=>{const s=t!=null;return[r=>e[0]({lengthComputable:s,total:t,loaded:r}),e[1]]},Bt=t=>(...e)=>c.asap(()=>t(...e)),Fr=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,Br=D.hasStandardBrowserEnv?{write(t,e,s,r,n,i){const o=[t+"="+encodeURIComponent(e)];c.isNumber(s)&&o.push("expires="+new Date(s).toGMTString()),c.isString(r)&&o.push("path="+r),c.isString(n)&&o.push("domain="+n),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $r(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function qr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $t(t,e,s){let r=!$r(e);return t&&(r||s==!1)?qr(t,e):e}const qt=t=>t instanceof $?{...t}:t;function X(t,e){e=e||{};const s={};function r(u,d,h,b){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:b},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function n(u,d,h,b){if(c.isUndefined(d)){if(!c.isUndefined(u))return r(void 0,u,h,b)}else return r(u,d,h,b)}function i(u,d){if(!c.isUndefined(d))return r(void 0,d)}function o(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:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d,h)=>n(qt(u),qt(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 Vt=t=>{const e=X({},t);let{data:s,withXSRFToken:r,xsrfHeaderName:n,xsrfCookieName:i,headers:o,auth:a}=e;e.headers=o=$.from(o),e.url=Tt($t(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(c.isFormData(s)){if(D.hasStandardBrowserEnv||D.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(h=>h.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(D.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(e)),r||r!==!1&&Fr(e.url))){const u=n&&i&&Br.read(i);u&&o.set(n,u)}return e},Vr=typeof XMLHttpRequest<"u",Mr=Vr&&function(t){return new Promise(function(e,s){const r=Vt(t);let n=r.data;const i=$.from(r.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=r,u,d,h,b,f;function w(){b&&b(),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 I(){if(!p)return;const E=$.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:E,config:t,request:p};Dt(function(V){e(V),w()},function(V){s(V),w()},O),p=null}"onloadend"in p?p.onloadend=I:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(I)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(){s(new v("Network Error",v.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let E=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const O=r.transitional||Nt;r.timeoutErrorMessage&&(E=r.timeoutErrorMessage),s(new v(E,O.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},n===void 0&&i.setContentType(null),"setRequestHeader"in p&&c.forEach(i.toJSON(),function(E,O){p.setRequestHeader(O,E)}),c.isUndefined(r.withCredentials)||(p.withCredentials=!!r.withCredentials),o&&o!=="json"&&(p.responseType=r.responseType),l&&([h,f]=Ie(l,!0),p.addEventListener("progress",h)),a&&p.upload&&([d,b]=Ie(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(r.cancelToken||r.signal)&&(u=E=>{p&&(s(!E||E.type?new ie(null,t,p):E),p.abort(),p=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const R=jr(r.url);if(R&&D.protocols.indexOf(R)===-1){s(new v("Unsupported protocol "+R+":",v.ERR_BAD_REQUEST,t));return}p.send(n||null)})},zr=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let r=new AbortController,n;const i=function(u){if(!n){n=!0,a();const d=u instanceof Error?u:this.reason;r.abort(d instanceof v?d:new ie(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>c.asap(a),l}},Wr=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},Jr=async function*(t,e){for await(const s of Hr(t))yield*Wr(s,e)},Hr=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()}},Mt=(t,e,s,r)=>{const n=Jr(t,e);let i=0,o,a=l=>{o||(o=!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 b=i+=h;s(b)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},Ae=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",zt=Ae&&typeof ReadableStream=="function",Kr=Ae&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Wt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Yr=zt&&Wt(()=>{let t=!1;const e=new Request(D.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Jt=64*1024,Ze=zt&&Wt(()=>c.isReadableStream(new Response("").body)),Te={stream:Ze&&(t=>t.body)};Ae&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Te[e]&&(Te[e]=c.isFunction(t[e])?s=>s[e]():(s,r)=>{throw new v(`Response type '${e}' is not supported`,v.ERR_NOT_SUPPORT,r)})})})(new Response);const Zr=async t=>{if(t==null)return 0;if(c.isBlob(t))return t.size;if(c.isSpecCompliantForm(t))return(await new Request(D.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(c.isArrayBufferView(t)||c.isArrayBuffer(t))return t.byteLength;if(c.isURLSearchParams(t)&&(t=t+""),c.isString(t))return(await Kr(t)).byteLength},Gr=async(t,e)=>c.toFiniteNumber(t.getContentLength())??Zr(e),Xr=Ae&&(async t=>{let{url:e,method:s,data:r,signal:n,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:b}=Vt(t);u=u?(u+"").toLowerCase():"text";let f=zr([n,i&&i.toAbortSignal()],o),w;const p=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let I;try{if(l&&Yr&&s!=="get"&&s!=="head"&&(I=await Gr(d,r))!==0){let _=new Request(e,{method:"POST",body:r,duplex:"half"}),j;if(c.isFormData(r)&&(j=_.headers.get("content-type"))&&d.setContentType(j),_.body){const[T,x]=Ft(I,Ie(Bt(l)));r=Mt(_.body,Jt,T,x)}}c.isString(h)||(h=h?"include":"omit");const R="credentials"in Request.prototype;w=new Request(e,{...b,signal:f,method:s.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:R?h:void 0});let E=await fetch(w,b);const O=Ze&&(u==="stream"||u==="response");if(Ze&&(a||O&&p)){const _={};["status","statusText","headers"].forEach(L=>{_[L]=E[L]});const j=c.toFiniteNumber(E.headers.get("content-length")),[T,x]=a&&Ft(j,Ie(Bt(a),!0))||[];E=new Response(Mt(E.body,Jt,T,()=>{x&&x(),p&&p()}),_)}u=u||"text";let V=await Te[c.findKey(Te,u)||"text"](E,t);return!O&&p&&p(),await new Promise((_,j)=>{Dt(_,j,{data:V,headers:$.from(E.headers),status:E.status,statusText:E.statusText,config:t,request:w})})}catch(R){throw p&&p(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,t,w),{cause:R.cause||R}):v.from(R,R&&R.code,t,w)}}),Ge={http:fr,xhr:Mr,fetch:Xr};c.forEach(Ge,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ht=t=>`- ${t}`,Qr=t=>c.isFunction(t)||t===null||t===!1,Kt={getAdapter:t=>{t=c.isArray(t)?t:[t];const{length:e}=t;let s,r;const n={};for(let i=0;i<e;i++){s=t[i];let o;if(r=s,!Qr(s)&&(r=Ge[(o=String(s)).toLowerCase()],r===void 0))throw new v(`Unknown adapter '${o}'`);if(r)break;n[o||"#"+i]=r}if(!r){const i=Object.entries(n).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
5
5
  `+i.map(Ht).join(`
6
- `):" "+Ht(i[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Ze};function Xe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ie(null,t)}function Gt(t){return Xe(t),t.headers=$.from(t.headers),t.data=Ge.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Kt.getAdapter(t.adapter||he.adapter)(t).then(function(e){return Xe(t),e.data=Ge.call(t,t.transformResponse,e),e.headers=$.from(e.headers),e},function(e){return Dt(e)||(Xe(t),e&&e.response&&(e.response.data=Ge.call(t,t.transformResponse,e.response),e.response.headers=$.from(e.response.headers))),Promise.reject(e)})}const Yt="1.11.0",Te={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Te[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Zt={};Te.transitional=function(t,e,s){function r(n,i){return"[Axios v"+Yt+"] Transitional option '"+n+"'"+i+(s?". "+s:"")}return(n,i,o)=>{if(t===!1)throw new v(r(i," has been removed"+(e?" in "+e:"")),v.ERR_DEPRECATED);return e&&!Zt[i]&&(Zt[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,i,o):!0}},Te.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function en(t,e,s){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const i=r[n],o=e[i];if(o){const a=t[i],l=a===void 0||o(a,i,t);if(l!==!0)throw new v("option "+i+" must be "+l,v.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new v("Unknown option "+i,v.ERR_BAD_OPTION)}}const Le={assertOptions:en,validators:Te},K=Le.validators;let Q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Lt,response:new Lt}}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=X(this.defaults,e);const{transitional:s,paramsSerializer:r,headers:n}=e;s!==void 0&&Le.assertOptions(s,{silentJSONParsing:K.transitional(K.boolean),forcedJSONParsing:K.transitional(K.boolean),clarifyTimeoutError:K.transitional(K.boolean)},!1),r!=null&&(c.isFunction(r)?e.paramsSerializer={serialize:r}:Le.assertOptions(r,{encode:K.function,serialize:K.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Le.assertOptions(e,{baseUrl:K.spelling("baseURL"),withXsrfToken:K.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=n&&c.merge(n.common,n[e.method]);n&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),e.headers=$.concat(i,n);const o=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(a=a&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,d=0,h;if(!a){const f=[Gt.bind(this),void 0];for(f.unshift(...o),f.push(...l),h=f.length,u=Promise.resolve(e);d<h;)u=u.then(f[d++],f[d++]);return u}h=o.length;let b=e;for(d=0;d<h;){const f=o[d++],w=o[d++];try{b=f(b)}catch(p){w.call(this,p);break}}try{u=Gt.call(this,b)}catch(f){return Promise.reject(f)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=X(this.defaults,t);const e=$t(t.baseURL,t.url,t.allowAbsoluteUrls);return Tt(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Q.prototype[t]=function(e,s){return this.request(X(s||{},{method:t,url:e,data:(s||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function e(s){return function(r,n,i){return this.request(X(i||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Q.prototype[t]=e(),Q.prototype[t+"Form"]=e(!0)});let tn=class ws{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 i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(n,i,o){r.reason||(r.reason=new ie(n,i,o),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 ws(function(s){e=s}),cancel:e}}};function sn(t){return function(e){return t.apply(null,e)}}function rn(t){return c.isObject(t)&&t.isAxiosError===!0}const Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach(([t,e])=>{Qe[e]=t});function Xt(t){const e=new Q(t),s=gt(Q.prototype.request,e);return c.extend(s,Q.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(r){return Xt(X(t,r))},s}const A=Xt(he);A.Axios=Q,A.CanceledError=ie,A.CancelToken=tn,A.isCancel=Dt,A.VERSION=Yt,A.toFormData=Oe,A.AxiosError=v,A.Cancel=A.CanceledError,A.all=function(t){return Promise.all(t)},A.spread=sn,A.isAxiosError=rn,A.mergeConfig=X,A.AxiosHeaders=$,A.formToJSON=t=>jt(c.isHTMLForm(t)?new FormData(t):t),A.getAdapter=Kt.getAdapter,A.HttpStatusCode=Qe,A.default=A;const{Axios:Ri,AxiosError:Ii,CanceledError:Ai,isCancel:Ti,CancelToken:Li,VERSION:Pi,all:ji,Cancel:Ni,isAxiosError:Di,spread:Ui,toFormData:Fi,AxiosHeaders:Bi,HttpStatusCode:$i,formToJSON:qi,getAdapter:Vi,mergeConfig:zi}=A,Qt=A.create({baseURL:location.origin,timeout:6e4,params:{}});Qt.interceptors.response.use(t=>t,t=>{var e,s,r,n,i,o,a,l,u,d,h;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(w){w&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(r=(s=t.response)==null?void 0:s.config)!=null&&r.data&&(b+=`${t.response.config.data} `),(i=(n=t.response)==null?void 0:n.data)!=null&&i.message?b+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.error)!=null&&d.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(h=t.response)==null?void 0:h.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:b}),t}else throw t});let Pe=()=>({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 pe extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class et extends pe{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class nn extends pe{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class W extends pe{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class on extends W{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function es(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 an{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 ee=Symbol("state");class ts{constructor(e={}){this.emitter=Pe(),this.params=Object.freeze(e),this.presence=new an(this),this.initialConnect=!0,this[ee]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=es({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[ee]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[ee]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[ee]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[ee]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[ee]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[ee]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let 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(i=>i()),s(n||new pe("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class cn{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(i=>{s=i}),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 ln{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 un{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new ln),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 cn(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 dn{constructor(e={}){this.subscriptions=new un(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 i=this.subscriptions.get(n);i&&i.channels.forEach(o=>{o.receive(s,r)})}notify(e,s,r){let n=this._remoteToLocal[e];if(!n)return;let i=this.subscriptions.get(n);i&&i.channels.forEach(o=>o.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 ss={debug:0,info:1,warn:2,error:3};class rs{constructor(e){this.level=e||"warn"}log(e,s,r){ss[e]<ss[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 me extends rs{writeLogEntry(){}}class hn{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let fn=0;class ns{constructor(e={}){let{logger:s}=e;this.logger=s||new me,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=es(r);if(this.pendingUnsubscriptions[n]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},o)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let i=this.subscribeRetryInterval;return new Promise((o,a)=>{let l=++fn;this.pendingSubscriptions[n]={resolve:o,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,i)})}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 nn(`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:i,reconnect:o}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new W(i);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[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 et)):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 is=()=>Date.now()/1e3|0;class pn extends ns{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=is()),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=is()),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 i=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of i)this.cable.send({identifier:o,command:"history",history:this.historyRequestFor(o)}),this.presenceInfo[o]&&this.cable.send({identifier:o,command:"join",presence:this.presenceInfo[o]});return this.cable.restored(i)}return this.cable.connected(this.sessionId)}if(s==="presence"){let i=n.type;if(i==="info"){let o=this.pendingPresence[r];o&&(delete this.pendingPresence[r],o.resolve(n))}else if(i==="error"){let o=this.pendingPresence[r];o&&(delete this.pendingPresence[r],o.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:r,message:n}}if(n){let i=this.trackStreamPosition(r,e.stream_id,e.epoch,e.offset);return{identifier:r,message:n,meta:i}}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 i=this.streamsPositions[n];i&&(r=!0,s[n]=i)}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 mn extends pe{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class tt extends ts{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ve(tt,"identifier","__ghost__");const gn="$pubsub";class st extends ts{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}ve(st,"identifier",gn);const te=Symbol("state");let bn=class{constructor({transport:t,protocol:e,encoder:s,logger:r,lazy:n,hubOptions:i,performFailures:o,transportConfigurator:a}){this.emitter=Pe(),this.transport=t,this.encoder=s,this.logger=r||new me,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new dn(i||{}),this[te]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,n===!1&&this.connect().catch(()=>{})}get state(){return this[te]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[te]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[te]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new W("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[te]="connected",this.hub.subscriptions.all().forEach(r=>{t&&r.remoteId&&t.includes(r.remoteId)?r.notify("restored"):(r.notify("disconnected",new W("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 W(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[te]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof W?t:new W(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[te]="closed";let s=e||new W("cable_closed");this.hub.subscriptions.all().forEach(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:i,meta:o}=s;r?this.hub.notify(n,r,i):this.hub.transmit(n,i,o)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new st({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new st({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,r;return typeof t=="string"&&(r=t,t=tt),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 i={identifier:e,params:s};this.logger.debug("subscribing",i);try{let o=await this.protocol.subscribe(e,s);this.hub.subscribe(r,o),this.logger.debug("subscribed",{...i,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof et&&this.logger.warn("rejected",i),o instanceof W){this.logger.debug("disconnected during subscription; will retry on connect",i),n.release();return}this.logger.error("failed to subscribe",{error:o,...i})}t.close(o),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 W?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 mn;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,i={id:n,action:e,payload:s};this.logger.debug("perform",i);try{let o=await this.protocol.perform(n,e,s);return o&&this.logger.debug("perform result",{message:o,request:i}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:i}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...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 _n={maxMissingPings:2,maxReconnectAttempts:1/0},oe=()=>Date.now(),os=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:r,maxInterval:n}=e;return s=s||2,r===void 0&&(r=.5),i=>{let o=t*s**i,a=o*s,l=o+(a-o)*Math.random(),u=2*(Math.random()-.5)*r;return l=l*(1+u),n&&n<l&&(l=n),l}};let as=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},_n,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 me,this.state="pending_connect",this.attempts=0,this.disconnectedAt=oe()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=oe(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=oe(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=oe(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=oe()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=oe()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new on))}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 yn{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Pe(),this.unbind=[],this.logger=s.logger||new me}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 wn{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=Pe();let{format:n,subprotocol:i,authStrategy:o}=s;this.format=n||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=i}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((s,r)=>{let n=[];n.push(this.once("open",()=>{n.forEach(i=>i()),s()})),n.push(this.once("close",()=>{n.forEach(i=>i()),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 cs={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function vn(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({},cs,e);let{protocol:s,websocketImplementation:r,websocketFormat:n,websocketOptions:i,websocketAuthStrategy:o,fallbacks:a,logLevel:l,logger:u,transport:d,encoder:h,lazy:b,monitor:f,pingInterval:w,reconnectStrategy:p,maxMissingPings:I,maxReconnectAttempts:R,subprotocol:E,tokenRefresher:O,historyTimestamp:V,protocolOptions:_,concurrentSubscribes:N,performFailures:T,transportConfigurator:x,auth:L}=e;if(u=u||new me(l),typeof s=="string"){E=E||s;let ae=s.substring(0,s.lastIndexOf("-")),q=s.substring(s.lastIndexOf("-")+1);if(_=_||{},ae==="actioncable-v1")s=new ns({logger:u,..._});else if(ae==="actioncable-v1-ext")s=new pn({logger:u,historyTimestamp:V,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(q==="json")h=h||new hn,n=n||"text";else if(q==="msgpack"){if(n="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(q==="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 wn(t,{websocketImplementation:r,websocketOptions:i,subprotocol:E,authStrategy:o,format:n}),a&&(d=new yn([d,...a],{logger:u})),L&&L.token&&d.setToken(L.token,L.param||"jid"),p=p||os(w),f!==!1&&(f=f||new as({pingInterval:w,reconnectStrategy:p,maxMissingPings:I,maxReconnectAttempts:R,logger:u}));let Fe={concurrentSubscribes:N},J=new bn({protocol:s,transport:d,encoder:h,logger:u,lazy:b,hubOptions:Fe,performFailures:T,transportConfigurator:x});return f&&(f.watch(J),J.monitor=f),O&&Sn(J,async()=>{try{await O(d)}catch(ae){return u.error("Failed to refresh authentication token: "+ae),!1}return J.connect().catch(()=>{}),!0}),J}function Sn(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 En{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 xn extends tt{constructor(e,s,r){super(e,s),this.subscription=new En(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 et?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Cn{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 i=new xn(r,n,s);return i.subscription.notify("initialized"),this.cable.subscribe(i),i.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class On{constructor(e){this.cable=e,this.subscriptions=new Cn(e)}}class kn extends rs{writeLogEntry(e,s,r){r?console[e](s,r):console[e](s)}}class Rn extends as{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 W("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",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 In=["cable","action-cable"],An="/cable",je=(t,e)=>{for(let s of In){let r=t.head.querySelector(`meta[name='${s}-${e}']`);if(r)return r.getAttribute("content")}},ls=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Tn=()=>{if(typeof document<"u"&&document.head){let t=je(document,"url");if(t)return ls(t)}return ls(An)},Ln=()=>{if(typeof document<"u"&&document.head){let t=je(document,"history-timestamp");if(t)return t|0}},Pn=()=>{if(typeof document<"u"&&document.head)return je(document,"token")},jn=()=>{if(typeof document<"u"&&document.head)return je(document,"token-param")};function Nn(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Tn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Ln());let s=Pn();if(s){let u=jn();e.auth=Object.assign({token:s,param:u},e.auth||{})}e=Object.assign({},cs,e);let{logLevel:r,logger:n,pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new kn(r),o=e.reconnectStrategy=e.reconnectStrategy||os(i),e.monitor!==!1&&(e.monitor=e.monitor||new Rn({pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l,logger:n})),vn(t,e)}function Dn(t,e){let s=Nn(t,e);return new On(s)}class us{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(i=>{if(i&&OpenC3Auth.setTokens(),this._cable==null){let o=this._url+"?scope="+encodeURIComponent(window.openc3Scope)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=Dn(o)}return this._cable.subscriptions.create({channel:e,...n},r)})}recordPing(){}}function Ne(t){return Un.test(t)}const Un=/^-?[0-9]+$/;function ds(t){return Fn.test(t)}const Fn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function hs(t,e){const s=Number.parseFloat(t),r=String(s);if(t===r)return!0;const n=fs(t),i=fs(r);return!!(n===i||(e==null?void 0:e.approx)===!0&&!Ne(t)&&i.length>=14&&n.startsWith(i.substring(0,14)))}let ge=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Bn(t){if(hs(t,{approx:!1}))return;if(Ne(t))return ge.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?ge.underflow:ge.truncate_float:ge.overflow}function fs(t){const{start:e,end:s}=$n(t),r=t.substring(e,s),n=r.indexOf(".");return n===-1?r:r.substring(0,n)+r.substring(n+1)}function $n(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 qn{constructor(e){if(ve(this,"isLosslessNumber",!0),!ds(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Bn(this.value);if(e===void 0||e===ge.truncate_float)return Number.parseFloat(this.value);if(Ne(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 Vn(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function zn(t){return new qn(t)}function Mn(t,e){return rt({"":t},"",t,e)}function rt(t,e,s,r){return Array.isArray(s)?r.call(t,e,Jn(s,r)):s&&typeof s=="object"&&!Vn(s)?r.call(t,e,Wn(s,r)):r.call(t,e,s)}function Wn(t,e){for(const s of Object.keys(t)){const r=rt(t,s,t[s],e);r!==void 0?t[s]=r:delete t[s]}return t}function Jn(t,e){for(let s=0;s<t.length;s++)t[s]=rt(t,String(s),t[s],e);return t}function Hn(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zn,r=0;const n=a();return w(n),I(),e?Mn(n,e):n;function i(){if(t.charCodeAt(r)===Qn){r++,u();const S={};let D=!0;for(;r<t.length&&t.charCodeAt(r)!==ms;){D?D=!1:(b(),u());const se=r,be=d();if(be===void 0){O();return}u(),f();const ct=a();if(ct===void 0){L();return}Object.prototype.hasOwnProperty.call(S,be)&&!nt(ct,S[be])&&V(be,se+1),S[be]=ct}return t.charCodeAt(r)!==ms&&_(),r++,S}}function o(){if(t.charCodeAt(r)===ei){r++,u();const S=[];let D=!0;for(;r<t.length&&t.charCodeAt(r)!==gs;){D?D=!1:b();const se=a();p(se),S.push(se)}return t.charCodeAt(r)!==gs&&N(),r++,S}}function a(){u();const S=d()??h()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),S}function l(S,D){if(t.slice(r,r+S.length)===S)return r+=S.length,D}function u(){for(;Kn(t.charCodeAt(r));)r++}function d(){if(t.charCodeAt(r)===it){r++;let S="";for(;r<t.length&&t.charCodeAt(r)!==it;){if(t.charCodeAt(r)===Xn){const D=t[r+1],se=Zn[D];se!==void 0?(S+=se,r++):D==="u"?De(t.charCodeAt(r+2))&&De(t.charCodeAt(r+3))&&De(t.charCodeAt(r+4))&&De(t.charCodeAt(r+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(r+2,r+6),16)),r+=5):Fe(r):x(r)}else Yn(t.charCodeAt(r))?S+=t[r]:T(t[r]);r++}return E(),r++,S}}function h(){const S=r;if(t.charCodeAt(r)===bs&&(r++,R(S)),t.charCodeAt(r)===ot)r++;else if(Gn(t.charCodeAt(r)))for(r++;Ue(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===ci)for(r++,R(S);Ue(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===fi||t.charCodeAt(r)===hi)for(r++,(t.charCodeAt(r)===bs||t.charCodeAt(r)===ii)&&r++,R(S);Ue(t.charCodeAt(r));)r++;if(r>S)return s(t.slice(S,r))}function b(){if(t.charCodeAt(r)!==ai)throw new SyntaxError(`Comma ',' expected after value ${q()}`);r++}function f(){if(t.charCodeAt(r)!==li)throw new SyntaxError(`Colon ':' expected after property name ${q()}`);r++}function w(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${q()}`)}function p(S){if(S===void 0)throw new SyntaxError(`Array item expected ${q()}`)}function I(){if(r<t.length)throw new SyntaxError(`Expected end of input ${q()}`)}function R(S){if(!Ue(t.charCodeAt(r))){const D=t.slice(S,r);throw new SyntaxError(`Invalid number '${D}', expecting a digit ${q()}`)}}function E(){if(t.charCodeAt(r)!==it)throw new SyntaxError(`End of string '"' expected ${q()}`)}function O(){throw new SyntaxError(`Quoted object key expected ${q()}`)}function V(S,D){throw new SyntaxError(`Duplicate key '${S}' encountered at position ${D}`)}function _(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${q()}`)}function N(){throw new SyntaxError(`Array item or end of array ']' expected ${q()}`)}function T(S){throw new SyntaxError(`Invalid character '${S}' ${J()}`)}function x(S){const D=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${D}' ${J()}`)}function L(){throw new SyntaxError(`Object value expected after ':' ${J()}`)}function Fe(S){const D=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${D}' ${J()}`)}function J(){return`at position ${r}`}function ae(){return r<t.length?`but got '${t[r]}'`:"but reached end of input"}function q(){return`${ae()} ${J()}`}}function Kn(t){return t===ti||t===si||t===ri||t===ni}function De(t){return t>=ot&&t<=at||t>=ui&&t<=pi||t>=di&&t<=mi}function Ue(t){return t>=ot&&t<=at}function Gn(t){return t>=oi&&t<=at}function Yn(t){return t>=32&&t<=1114111}function nt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,r)=>nt(s,e[r])):ps(t)&&ps(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>nt(t[s],e[s])):!1}function ps(t){return typeof t=="object"&&t!==null}const Zn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
- `,r:"\r",t:" "},Xn=92,Qn=123,ms=125,ei=91,gs=93,ti=32,si=10,ri=9,ni=13,it=34,ii=43,bs=45,ot=48,oi=49,at=57,ai=44,ci=46,li=58,ui=65,di=97,hi=69,fi=101,pi=70,mi=102;function _s(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"||!ds(h))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${h})`);return h}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return i(l);if(l&&typeof l=="object")return o(l)}function i(l,u){if(l.length===0)return"[]";let d="[";for(let h=0;h<l.length;h++){const b=l[h];typeof b<"u"&&typeof b!="function"?d+=n(b):d+="null",h<l.length-1&&(d+=",")}return d+="]",d}function o(l,u){if(typeof l.toJSON=="function")return _s(l.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(l);if(d.length===0)return"{}";let h=!0,b="{";for(const f of d){const w=l[f];if(a(f,w)){h?h=!1:b+=",";const p=JSON.stringify(f);b+=`${p}:`,b+=n(w)}}return b+="}",b}function a(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function gi(t){return Ne(t)&&!hs(t)?BigInt(t):parseFloat(t)}class ys{constructor(){ve(this,"id",1)}async exec(e,s,r={},n={},i=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 Qt.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:i,transformRequest:[(o,a)=>_s(o)],transformResponse:[o=>Hn(o,void 0,gi)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a=o,a}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,s){return this.exec("map_target_to_interface",[e,s])}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...r){return this.exec("interface_cmd",[e,s,...r])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,s,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 i=await this.exec("get_tlm_packet",[e,s],{type:r,stale_time:n});if(i!=null){let o=i.length,a=null;for(let l=0;l<o;l++)a=this.decode_openc3_type(i[l][1]),a!==null&&(i[l][1]=a)}return i}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,s=30,r=null,n=null,i=null){let o={stale_time:s};r!==null&&(o.cache_timeout=r),n!==null&&(o.start_time=n.toISOString()),i!==null&&(o.end_time=i.toISOString());const a=await this.exec("get_tlm_values",[e],o,{},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 i=null;if(s===void 0)i=await this.exec("tlm",[e]);else if(r===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))i=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else i=await this.exec("tlm",[e,s,r],{type:n});let o=this.decode_openc3_type(i);return o!==null&&(i=o),i}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,i){let o=null;for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o=this.encode_openc3_type(n[a]),o!==null&&(n[a]=o));return this.exec(e,[s,r,n],{},i)}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={}){return s===void 0?this.exec("cmd",e,{},n):this._cmd("cmd",e,s,r,n)}cmd_no_range_check(e,s,r,n={}){return s===void 0?this.exec("cmd_no_range_check",e,{},n):this._cmd("cmd_no_range_check",e,s,r,n)}cmd_raw(e,s,r,n={}){return s===void 0?this.exec("cmd_raw",e,{},n):this._cmd("cmd_raw",e,s,r,n)}cmd_raw_no_range_check(e,s,r,n={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,{},n):this._cmd("cmd_raw_no_range_check",e,s,r,n)}cmd_no_hazardous_check(e,s,r,n={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,{},n):this._cmd("cmd_no_hazardous_check",e,s,r,n)}cmd_no_checks(e,s,r,n={}){return s===void 0?this.exec("cmd_no_checks",e,{},n):this._cmd("cmd_no_checks",e,s,r,n)}cmd_raw_no_hazardous_check(e,s,r,n={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},n):this._cmd("cmd_raw_no_hazardous_check",e,s,r,n)}cmd_raw_no_checks(e,s,r,n={}){return s===void 0?this.exec("cmd_raw_no_checks",e,{},n):this._cmd("cmd_raw_no_checks",e,s,r,n)}build_cmd(e,s,r){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,r)}build_command(e,s,r){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,r)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,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(i=>i.toString(16).padStart(2,"0")).join("")}}}const bi={components:{ValueWidget:pt,ValuelimitsbarWidget:mt},mixins:[Be],props:{modelValue:{type:Array,default:()=>[]},timeZone:{type:String,default:"local"}},data(){return{api:null,cable:new us,ignored:[],ignoredItemsDialog:!1,overallState:"GREEN",currentLimitsSet:"",items:[],itemList:[],screenItems:[],screenValues:{},updateCounter:0,itemsPerPage:25,search:"",headers:[{title:"Timestamp",key:"timestamp",width:"130px",sortable:!0,nowrap:!0},{title:"Item",key:"item",value:t=>t.parameters[2],sortable:!0,minWidth:"100px",width:"200px",maxWidth:"300px"},{title:"Value",key:"value",width:"380px",sortable:!1},{title:"Controls",key:"actions",width:"80px",sortable:!1},{title:"",key:"limits",sortable:!1}],valueLimitsBarWidgetSettings:[["WIDTH","380px"],["0","WIDTH","200px"],["1","WIDTH","180px"]],valueWidgetSettings:[["WIDTH","200px"]]}},computed:{textFieldClass(){return this.overallState?`textfield-${this.overallState.toLowerCase()}`:""},overallStateFormatted(){return this.ignored.length===0?this.overallState:`${this.overallState} (Some items ignored)`},ignoredFormatted(){return this.ignored.map(t=>t.split("__").join(" "))},astroStatus(){switch(this.overallState){case"GREEN":return"normal";case"YELLOW":return"caution";case"RED":return"critical";case"BLUE":return"standby";default:return null}}},created(){this.api=new ys;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("__"),i=`${s}__${r}`;for(this.ignored.push(i),e||this.updateIgnored();;){let o=this.itemList.findIndex(a=>a.includes(i));if(o===-1)break;{let a=this.itemList[o].lastIndexOf("__");this.removeItem(this.itemList[o].substring(0,a))}}this.calcOverallState()},ignoreItem(t,e){this.ignored.push(t),e||this.updateIgnored(),this.removeItem(t),this.calcOverallState()},restoreItem(t){this.ignored.splice(t,1),this.updateIgnored(),this.updateOutOfLimits()},removeItem(t){const e=this.itemList.findIndex(s=>s.includes(t));this.items.splice(e,1),this.itemList.splice(e,1)},clearAll(){this.ignored=[],this.updateIgnored(),this.updateOutOfLimits()},updateIgnored(){this.$emit("update:modelValue",this.ignored)},handleConfigEvents(t){for(let e of t)e.kind==="deleted"&&e.type==="target"&&this.updateOutOfLimits()},handleMessages(t){for(let e of t){let s=JSON.parse(e.event);if(s.type!="LIMITS_CHANGE")continue;let r=`${s.target_name}__${s.packet_name}__${s.item_name}`;const n=this.itemList.findIndex(o=>o.includes(r));if(n!==-1){this.itemList[n]=`${r}__${s.new_limits_state}`,this.calcOverallState();continue}if(this.ignored.find(o=>r.includes(o))||s.new_limits_state&&!(s.new_limits_state.includes("YELLOW")||s.new_limits_state.includes("RED")))continue;let i={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"?i.limits=!1:i.limits=!0,this.itemList.push(`${r}__${s.new_limits_state}`),this.items.push(i),this.calcOverallState()}},update(){this.screenItems.length!==0&&this.api.get_tlm_values(this.screenItems).then(t=>{this.updateValues(t)})},updateValues:function(t){this.updateCounter+=1;for(let e=0;e<t.length;e++)t[e].push(this.updateCounter),this.screenValues[this.screenItems[e]]=t[e]},addItem:function(t){this.screenItems.push(t),this.screenValues[t]=[null,null,0]},deleteItem:function(t){let e=this.screenItems.indexOf(t);this.screenItems.splice(e,1)},showIgnored(){this.ignoredItemsDialog=!0},customFilter(t,e,s){if(!e||e.trim()==="")return!0;if(e=e.toLowerCase(),s.parameters&&s.parameters.length>0){for(const 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))}}},_i=["status"],yi={class:"font-weight-black"};function wi(t,e,s,r,n,i){const o=y("v-text-field"),a=y("v-spacer"),l=y("v-row"),u=y("valuelimitsbar-widget"),d=y("value-widget"),h=y("v-btn"),b=y("v-icon"),f=y("v-list-item-title"),w=y("v-list-item"),p=y("v-list"),I=y("v-menu"),R=y("v-data-table"),E=y("v-card"),O=y("v-toolbar"),V=y("v-divider"),_=y("v-card-text"),N=y("v-card-actions"),T=y("v-dialog");return k(),z("div",null,[g(E,{class:"pa-5"},{default:m(()=>[g(l,{class:"ma-1"},{default:m(()=>[g(o,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Overall Limits State","model-value":i.overallStateFormatted,class:qe(i.textFieldClass),style:{"margin-right":"10px","max-width":"280px"},"data-test":"overall-state"},we({_:2},[i.astroStatus?{name:"prepend-inner",fn:m(()=>[F("rux-status",{status:i.astroStatus},null,8,_i)]),key:"0"}:void 0]),1032,["model-value","class"]),g(o,{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"]),g(a),g(o,{modelValue:n.search,"onUpdate:modelValue":e[0]||(e[0]=x=>n.search=x),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",style:{"max-width":"300px"},"data-test":"search"},null,8,["modelValue"])]),_:1}),g(R,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[1]||(e[1]=x=>n.itemsPerPage=x),headers:n.headers,items:n.items,search:n.search,"custom-filter":i.customFilter,"item-value":"key","data-test":"limits-table",class:"limits-table",density:"compact"},{"item.timestamp":m(({item:x})=>[j(H(x.timestamp),1)]),"item.value":m(({item:x})=>[x.limits?(k(),P(u,{key:0,parameters:x.parameters,settings:n.valueLimitsBarWidgetSettings,"screen-values":n.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"])):(k(),P(d,{key:1,parameters:x.parameters,settings:n.valueWidgetSettings,"screen-values":n.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"]))]),"item.actions":m(({item:x})=>[g(I,null,{activator:m(({props:L})=>[g(h,ye({icon:"mdi-dots-horizontal",variant:"text",density:"compact","aria-label":"Item Options"},L),null,16)]),default:m(()=>[g(p,null,{default:m(()=>[g(w,{onClick:L=>i.ignorePacket(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[4]||(e[4]=[j("mdi-close-circle-multiple",-1)])),_:1,__:[4]})]),default:m(()=>[g(f,null,{default:m(()=>e[5]||(e[5]=[j("Ignore Entire Packet",-1)])),_:1,__:[5]})]),_:2},1032,["onClick"]),g(w,{onClick:L=>i.ignoreItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[6]||(e[6]=[j("mdi-close-circle",-1)])),_:1,__:[6]})]),default:m(()=>[g(f,null,{default:m(()=>e[7]||(e[7]=[j("Ignore Item",-1)])),_:1,__:[7]})]),_:2},1032,["onClick"]),g(w,{onClick:L=>i.removeItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>e[8]||(e[8]=[j("mdi-eye-off",-1)])),_:1,__:[8]})]),default:m(()=>[g(f,null,{default:m(()=>e[9]||(e[9]=[j("Temporarily Hide Item",-1)])),_:1,__:[9]})]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),"item.limits":m(({item:x})=>[g(a)]),_:1},8,["items-per-page","headers","items","search","custom-filter"]),e[10]||(e[10]=F("div",{class:"footer"},' Note: Timestamp is "now" for items currently out of limits when the page is loaded. ',-1))]),_:1,__:[10]}),g(T,{modelValue:n.ignoredItemsDialog,"onUpdate:modelValue":e[3]||(e[3]=x=>n.ignoredItemsDialog=x),"max-width":"600"},{default:m(()=>[g(E,null,{default:m(()=>[g(O,{height:"24"},{default:m(()=>[g(a),e[11]||(e[11]=F("span",null,"Ignored Items",-1)),g(a)]),_:1,__:[11]}),g(_,{class:"mt-2"},{default:m(()=>[F("div",null,[(k(!0),z(G,null,re(i.ignoredFormatted,(x,L)=>(k(),z("div",{key:L},[g(l,{class:"ma-1 align-center"},{default:m(()=>[F("span",yi,H(x),1),g(a),g(h,{icon:"mdi-delete",density:"compact",variant:"text","aria-label":"Remove Ignored Item","data-test":`remove-ignore-${L}`,onClick:Fe=>i.restoreItem(L)},null,8,["data-test","onClick"])]),_:2},1024),L<i.ignoredFormatted.length-1?(k(),P(V,{key:L})):Y("",!0)]))),128))])]),_:1}),g(N,{class:"px-2"},{default:m(()=>[g(h,{variant:"outlined",onClick:i.clearAll},{default:m(()=>e[12]||(e[12]=[j(" Clear All ",-1)])),_:1,__:[12]},8,["onClick"]),g(a),g(h,{variant:"flat",onClick:e[2]||(e[2]=x=>n.ignoredItemsDialog=!1)},{default:m(()=>e[13]||(e[13]=[j(" Ok ",-1)])),_:1,__:[13]})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const vi=_e(bi,[["render",wi],["__scopeId","data-v-ed7ec5ac"]]),Si={mixins:[Be],props:{historyCount:{type:Number,default:1e3},timeZone:{type:String,default:"local"}},data(){return{data:[],cable:new us,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}}},Ei=["status"];function xi(t,e,s,r,n,i){const o=y("v-spacer"),a=y("v-text-field"),l=y("v-card-title"),u=y("v-data-table"),d=y("v-card");return k(),P(d,{class:"card-height"},{default:m(()=>[g(l,{class:"d-flex align-center"},{default:m(()=>[e[1]||(e[1]=j(" Limits Events ",-1)),g(o),g(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,__:[1]}),g(u,{headers:n.headers,items:n.data,search:n.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact",height:i.calcTableHeight(),hover:"","data-test":"limits-events"},{"item.time_nsec":m(({item:h})=>[F("span",null,H(t.formatNanoseconds(h.time_nsec,s.timeZone)),1)]),"item.level":m(({item:h})=>[F("rux-status",{status:i.getStatus(h.message)},null,8,Ei)]),"item.message":m(({item:h})=>[F("span",{class:qe(i.getColorClass(h.message))},H(h.message),3)]),_:1},8,["headers","items","search","height"])]),_:1})}const Ci={components:{LimitsControl:vi,LimitsEvents:_e(Si,[["render",xi],["__scopeId","data-v-3c276116"]]),TopBar:Cs,OpenConfigDialog:ht,SaveConfigDialog:dt},mixins:[ut],data(){return{title:"Limits Monitor",configKey:"limits_monitor",api:new ys,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 Oi(t,e,s,r,n,i){const o=y("top-bar"),a=y("limits-control"),l=y("limits-events"),u=y("open-config-dialog"),d=y("save-config-dialog"),h=y("v-spacer"),b=y("v-toolbar"),f=y("v-select"),w=y("v-card-text"),p=y("v-btn"),I=y("v-card-actions"),R=y("v-card"),E=y("v-dialog");return k(),z("div",null,[g(o,{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]=O=>n.ignored=O),"time-zone":n.timeZone},null,8,["modelValue","time-zone"])),e[11]||(e[11]=F("div",{style:{height:"15px"}},null,-1)),g(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]=O=>n.openConfig=O),"config-key":n.configKey,onSuccess:i.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):Y("",!0),n.saveConfig?(k(),P(d,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[2]||(e[2]=O=>n.saveConfig=O),"config-key":n.configKey,onSuccess:i.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):Y("",!0),g(E,{modelValue:n.limitsSetDialog,"onUpdate:modelValue":e[5]||(e[5]=O=>n.limitsSetDialog=O),"max-width":"650"},{default:m(()=>[g(R,null,{default:m(()=>[g(b,{height:"24"},{default:m(()=>[g(h),e[6]||(e[6]=F("span",null,"Change Limits Set",-1)),g(h)]),_:1,__:[6]}),g(w,{class:"mt-6"},{default:m(()=>[e[7]||(e[7]=F("span",{style:{display:"block"}}," The Limits Set is a global option which changes the Limits Set across all tools. ",-1)),e[8]||(e[8]=F("span",{style:{display:"block"}}," NOTE: Changing this option clears the current list and recalculates based on the new set. ",-1)),g(f,{modelValue:n.currentLimitsSet,"onUpdate:modelValue":e[3]||(e[3]=O=>n.currentLimitsSet=O),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,__:[7,8]}),g(I,{class:"px-2"},{default:m(()=>[g(h),g(p,{variant:"outlined",onClick:e[4]||(e[4]=O=>n.limitsSetDialog=!1)},{default:m(()=>e[9]||(e[9]=[j(" Cancel ",-1)])),_:1,__:[9]}),g(p,{variant:"flat",onClick:i.setLimitsSet},{default:m(()=>e[10]||(e[10]=[j(" Ok ",-1)])),_:1,__:[10]},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Wi=vs("default",_e(Ci,[["render",Oi]]))}}});
6
+ `):" "+Ht(i[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Ge};function Xe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ie(null,t)}function Yt(t){return Xe(t),t.headers=$.from(t.headers),t.data=Ye.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Kt.getAdapter(t.adapter||he.adapter)(t).then(function(e){return Xe(t),e.data=Ye.call(t,t.transformResponse,e),e.headers=$.from(e.headers),e},function(e){return Ut(e)||(Xe(t),e&&e.response&&(e.response.data=Ye.call(t,t.transformResponse,e.response),e.response.headers=$.from(e.response.headers))),Promise.reject(e)})}const Zt="1.11.0",Le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Le[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Gt={};Le.transitional=function(t,e,s){function r(n,i){return"[Axios v"+Zt+"] Transitional option '"+n+"'"+i+(s?". "+s:"")}return(n,i,o)=>{if(t===!1)throw new v(r(i," has been removed"+(e?" in "+e:"")),v.ERR_DEPRECATED);return e&&!Gt[i]&&(Gt[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,i,o):!0}},Le.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function en(t,e,s){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const i=r[n],o=e[i];if(o){const a=t[i],l=a===void 0||o(a,i,t);if(l!==!0)throw new v("option "+i+" must be "+l,v.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new v("Unknown option "+i,v.ERR_BAD_OPTION)}}const Ne={assertOptions:en,validators:Le},K=Ne.validators;let Q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Lt,response:new Lt}}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=X(this.defaults,e);const{transitional:s,paramsSerializer:r,headers:n}=e;s!==void 0&&Ne.assertOptions(s,{silentJSONParsing:K.transitional(K.boolean),forcedJSONParsing:K.transitional(K.boolean),clarifyTimeoutError:K.transitional(K.boolean)},!1),r!=null&&(c.isFunction(r)?e.paramsSerializer={serialize:r}:Ne.assertOptions(r,{encode:K.function,serialize:K.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ne.assertOptions(e,{baseUrl:K.spelling("baseURL"),withXsrfToken:K.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=n&&c.merge(n.common,n[e.method]);n&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),e.headers=$.concat(i,n);const o=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(a=a&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,d=0,h;if(!a){const f=[Yt.bind(this),void 0];for(f.unshift(...o),f.push(...l),h=f.length,u=Promise.resolve(e);d<h;)u=u.then(f[d++],f[d++]);return u}h=o.length;let b=e;for(d=0;d<h;){const f=o[d++],w=o[d++];try{b=f(b)}catch(p){w.call(this,p);break}}try{u=Yt.call(this,b)}catch(f){return Promise.reject(f)}for(d=0,h=l.length;d<h;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=X(this.defaults,t);const e=$t(t.baseURL,t.url,t.allowAbsoluteUrls);return Tt(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Q.prototype[t]=function(e,s){return this.request(X(s||{},{method:t,url:e,data:(s||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function e(s){return function(r,n,i){return this.request(X(i||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Q.prototype[t]=e(),Q.prototype[t+"Form"]=e(!0)});let tn=class ws{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 i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(n);return o.cancel=function(){r.unsubscribe(i)},o},e(function(n,i,o){r.reason||(r.reason=new ie(n,i,o),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 ws(function(s){e=s}),cancel:e}}};function sn(t){return function(e){return t.apply(null,e)}}function rn(t){return c.isObject(t)&&t.isAxiosError===!0}const Qe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qe).forEach(([t,e])=>{Qe[e]=t});function Xt(t){const e=new Q(t),s=gt(Q.prototype.request,e);return c.extend(s,Q.prototype,e,{allOwnKeys:!0}),c.extend(s,e,null,{allOwnKeys:!0}),s.create=function(r){return Xt(X(t,r))},s}const A=Xt(he);A.Axios=Q,A.CanceledError=ie,A.CancelToken=tn,A.isCancel=Ut,A.VERSION=Zt,A.toFormData=ke,A.AxiosError=v,A.Cancel=A.CanceledError,A.all=function(t){return Promise.all(t)},A.spread=sn,A.isAxiosError=rn,A.mergeConfig=X,A.AxiosHeaders=$,A.formToJSON=t=>Pt(c.isHTMLForm(t)?new FormData(t):t),A.getAdapter=Kt.getAdapter,A.HttpStatusCode=Qe,A.default=A;const{Axios:Ri,AxiosError:Ii,CanceledError:Ai,isCancel:Ti,CancelToken:Li,VERSION:Ni,all:Pi,Cancel:ji,isAxiosError:Ui,spread:Di,toFormData:Fi,AxiosHeaders:Bi,HttpStatusCode:$i,formToJSON:qi,getAdapter:Vi,mergeConfig:Mi}=A,Qt=A.create({baseURL:location.origin,timeout:6e4,params:{}});Qt.interceptors.response.use(t=>t,t=>{var e,s,r,n,i,o,a,l,u,d,h;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(w){w&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(r=(s=t.response)==null?void 0:s.config)!=null&&r.data&&(b+=`${t.response.config.data} `),(i=(n=t.response)==null?void 0:n.data)!=null&&i.message?b+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.error)!=null&&d.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(h=t.response)==null?void 0:h.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:b}),t}else throw t});let Pe=()=>({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 pe extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class et extends pe{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class nn extends pe{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class W extends pe{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class on extends W{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function es(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 an{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 ee=Symbol("state");class ts{constructor(e={}){this.emitter=Pe(),this.params=Object.freeze(e),this.presence=new an(this),this.initialConnect=!0,this[ee]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=es({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[ee]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[ee]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[ee]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[ee]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[ee]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[ee]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let 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(i=>i()),s(n||new pe("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class cn{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(i=>{s=i}),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 ln{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 un{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new ln),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 cn(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 dn{constructor(e={}){this.subscriptions=new un(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 i=this.subscriptions.get(n);i&&i.channels.forEach(o=>{o.receive(s,r)})}notify(e,s,r){let n=this._remoteToLocal[e];if(!n)return;let i=this.subscriptions.get(n);i&&i.channels.forEach(o=>o.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 ss={debug:0,info:1,warn:2,error:3};class rs{constructor(e){this.level=e||"warn"}log(e,s,r){ss[e]<ss[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 me extends rs{writeLogEntry(){}}class hn{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let fn=0;class ns{constructor(e={}){let{logger:s}=e;this.logger=s||new me,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=es(r);if(this.pendingUnsubscriptions[n]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},o)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let i=this.subscribeRetryInterval;return new Promise((o,a)=>{let l=++fn;this.pendingSubscriptions[n]={resolve:o,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,i)})}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 nn(`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:i,reconnect:o}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new W(i);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[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 et)):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 is=()=>Date.now()/1e3|0;class pn extends ns{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=is()),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=is()),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 i=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of i)this.cable.send({identifier:o,command:"history",history:this.historyRequestFor(o)}),this.presenceInfo[o]&&this.cable.send({identifier:o,command:"join",presence:this.presenceInfo[o]});return this.cable.restored(i)}return this.cable.connected(this.sessionId)}if(s==="presence"){let i=n.type;if(i==="info"){let o=this.pendingPresence[r];o&&(delete this.pendingPresence[r],o.resolve(n))}else if(i==="error"){let o=this.pendingPresence[r];o&&(delete this.pendingPresence[r],o.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:r,message:n}}if(n){let i=this.trackStreamPosition(r,e.stream_id,e.epoch,e.offset);return{identifier:r,message:n,meta:i}}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 i=this.streamsPositions[n];i&&(r=!0,s[n]=i)}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 mn extends pe{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class tt extends ts{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}Se(tt,"identifier","__ghost__");const gn="$pubsub";class st extends ts{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}Se(st,"identifier",gn);const te=Symbol("state");let bn=class{constructor({transport:t,protocol:e,encoder:s,logger:r,lazy:n,hubOptions:i,performFailures:o,transportConfigurator:a}){this.emitter=Pe(),this.transport=t,this.encoder=s,this.logger=r||new me,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new dn(i||{}),this[te]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,n===!1&&this.connect().catch(()=>{})}get state(){return this[te]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[te]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[te]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new W("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[te]="connected",this.hub.subscriptions.all().forEach(r=>{t&&r.remoteId&&t.includes(r.remoteId)?r.notify("restored"):(r.notify("disconnected",new W("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 W(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[te]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof W?t:new W(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[te]="closed";let s=e||new W("cable_closed");this.hub.subscriptions.all().forEach(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:i,meta:o}=s;r?this.hub.notify(n,r,i):this.hub.transmit(n,i,o)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new st({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new st({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,r;return typeof t=="string"&&(r=t,t=tt),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 i={identifier:e,params:s};this.logger.debug("subscribing",i);try{let o=await this.protocol.subscribe(e,s);this.hub.subscribe(r,o),this.logger.debug("subscribed",{...i,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof et&&this.logger.warn("rejected",i),o instanceof W){this.logger.debug("disconnected during subscription; will retry on connect",i),n.release();return}this.logger.error("failed to subscribe",{error:o,...i})}t.close(o),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 W?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 mn;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,i={id:n,action:e,payload:s};this.logger.debug("perform",i);try{let o=await this.protocol.perform(n,e,s);return o&&this.logger.debug("perform result",{message:o,request:i}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:i}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...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 _n={maxMissingPings:2,maxReconnectAttempts:1/0},oe=()=>Date.now(),os=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:r,maxInterval:n}=e;return s=s||2,r===void 0&&(r=.5),i=>{let o=t*s**i,a=o*s,l=o+(a-o)*Math.random(),u=2*(Math.random()-.5)*r;return l=l*(1+u),n&&n<l&&(l=n),l}};let as=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},_n,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 me,this.state="pending_connect",this.attempts=0,this.disconnectedAt=oe()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=oe(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=oe(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=oe(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=oe()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=oe()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new on))}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 yn{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Pe(),this.unbind=[],this.logger=s.logger||new me}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 wn{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=Pe();let{format:n,subprotocol:i,authStrategy:o}=s;this.format=n||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=i}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((s,r)=>{let n=[];n.push(this.once("open",()=>{n.forEach(i=>i()),s()})),n.push(this.once("close",()=>{n.forEach(i=>i()),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 cs={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function vn(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({},cs,e);let{protocol:s,websocketImplementation:r,websocketFormat:n,websocketOptions:i,websocketAuthStrategy:o,fallbacks:a,logLevel:l,logger:u,transport:d,encoder:h,lazy:b,monitor:f,pingInterval:w,reconnectStrategy:p,maxMissingPings:I,maxReconnectAttempts:R,subprotocol:E,tokenRefresher:O,historyTimestamp:V,protocolOptions:_,concurrentSubscribes:j,performFailures:T,transportConfigurator:x,auth:L}=e;if(u=u||new me(l),typeof s=="string"){E=E||s;let ae=s.substring(0,s.lastIndexOf("-")),q=s.substring(s.lastIndexOf("-")+1);if(_=_||{},ae==="actioncable-v1")s=new ns({logger:u,..._});else if(ae==="actioncable-v1-ext")s=new pn({logger:u,historyTimestamp:V,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(q==="json")h=h||new hn,n=n||"text";else if(q==="msgpack"){if(n="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(q==="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 wn(t,{websocketImplementation:r,websocketOptions:i,subprotocol:E,authStrategy:o,format:n}),a&&(d=new yn([d,...a],{logger:u})),L&&L.token&&d.setToken(L.token,L.param||"jid"),p=p||os(w),f!==!1&&(f=f||new as({pingInterval:w,reconnectStrategy:p,maxMissingPings:I,maxReconnectAttempts:R,logger:u}));let Fe={concurrentSubscribes:j},J=new bn({protocol:s,transport:d,encoder:h,logger:u,lazy:b,hubOptions:Fe,performFailures:T,transportConfigurator:x});return f&&(f.watch(J),J.monitor=f),O&&Sn(J,async()=>{try{await O(d)}catch(ae){return u.error("Failed to refresh authentication token: "+ae),!1}return J.connect().catch(()=>{}),!0}),J}function Sn(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 En{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 xn extends tt{constructor(e,s,r){super(e,s),this.subscription=new En(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 et?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Cn{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 i=new xn(r,n,s);return i.subscription.notify("initialized"),this.cable.subscribe(i),i.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class On{constructor(e){this.cable=e,this.subscriptions=new Cn(e)}}class kn extends rs{writeLogEntry(e,s,r){r?console[e](s,r):console[e](s)}}class Rn extends as{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 W("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",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 In=["cable","action-cable"],An="/cable",je=(t,e)=>{for(let s of In){let r=t.head.querySelector(`meta[name='${s}-${e}']`);if(r)return r.getAttribute("content")}},ls=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Tn=()=>{if(typeof document<"u"&&document.head){let t=je(document,"url");if(t)return ls(t)}return ls(An)},Ln=()=>{if(typeof document<"u"&&document.head){let t=je(document,"history-timestamp");if(t)return t|0}},Nn=()=>{if(typeof document<"u"&&document.head)return je(document,"token")},Pn=()=>{if(typeof document<"u"&&document.head)return je(document,"token-param")};function jn(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Tn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Ln());let s=Nn();if(s){let u=Pn();e.auth=Object.assign({token:s,param:u},e.auth||{})}e=Object.assign({},cs,e);let{logLevel:r,logger:n,pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new kn(r),o=e.reconnectStrategy=e.reconnectStrategy||os(i),e.monitor!==!1&&(e.monitor=e.monitor||new Rn({pingInterval:i,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:l,logger:n})),vn(t,e)}function Un(t,e){let s=jn(t,e);return new On(s)}class us{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(i=>{if(i&&OpenC3Auth.setTokens(),this._cable==null){let o=this._url+"?scope="+encodeURIComponent(s)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=Un(o)}return this._cable.subscriptions.create({channel:e,...n},r)})}recordPing(){}}function ge(t){return Dn.test(t)}const Dn=/^-?[0-9]+$/;function ds(t){return Fn.test(t)}const Fn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function hs(t,e){if(ge(t))return Number.isSafeInteger(Number.parseInt(t,10));const s=Number.parseFloat(t),r=String(s);if(t===r)return!0;const n=fs(t),i=fs(r);return!!(n===i||(e==null?void 0:e.approx)===!0&&!ge(t)&&i.length>=14&&n.startsWith(i.substring(0,14)))}let be=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function Bn(t){if(hs(t,{approx:!1}))return;if(ge(t))return be.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?be.underflow:be.truncate_float:be.overflow}function fs(t){const{start:e,end:s}=$n(t),r=t.substring(e,s),n=r.indexOf(".");return n===-1?r:r.substring(0,n)+r.substring(n+1)}function $n(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 qn{constructor(e){if(Se(this,"isLosslessNumber",!0),!ds(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Bn(this.value);if(e===void 0||e===be.truncate_float)return Number.parseFloat(this.value);if(ge(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 Vn(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function Mn(t){return new qn(t)}function zn(t,e){return rt({"":t},"",t,e)}function rt(t,e,s,r){return Array.isArray(s)?r.call(t,e,Jn(s,r)):s&&typeof s=="object"&&!Vn(s)?r.call(t,e,Wn(s,r)):r.call(t,e,s)}function Wn(t,e){for(const s of Object.keys(t)){const r=rt(t,s,t[s],e);r!==void 0?t[s]=r:delete t[s]}return t}function Jn(t,e){for(let s=0;s<t.length;s++)t[s]=rt(t,String(s),t[s],e);return t}function Hn(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Mn,r=0;const n=a();return w(n),I(),e?zn(n,e):n;function i(){if(t.charCodeAt(r)===Qn){r++,u();const S={};let U=!0;for(;r<t.length&&t.charCodeAt(r)!==ms;){U?U=!1:(b(),u());const se=r,_e=d();if(_e===void 0){O();return}u(),f();const ct=a();if(ct===void 0){L();return}Object.prototype.hasOwnProperty.call(S,_e)&&!nt(ct,S[_e])&&V(_e,se+1),S[_e]=ct}return t.charCodeAt(r)!==ms&&_(),r++,S}}function o(){if(t.charCodeAt(r)===ei){r++,u();const S=[];let U=!0;for(;r<t.length&&t.charCodeAt(r)!==gs;){U?U=!1:b();const se=a();p(se),S.push(se)}return t.charCodeAt(r)!==gs&&j(),r++,S}}function a(){u();const S=d()??h()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),S}function l(S,U){if(t.slice(r,r+S.length)===S)return r+=S.length,U}function u(){for(;Kn(t.charCodeAt(r));)r++}function d(){if(t.charCodeAt(r)===it){r++;let S="";for(;r<t.length&&t.charCodeAt(r)!==it;){if(t.charCodeAt(r)===Xn){const U=t[r+1],se=Gn[U];se!==void 0?(S+=se,r++):U==="u"?Ue(t.charCodeAt(r+2))&&Ue(t.charCodeAt(r+3))&&Ue(t.charCodeAt(r+4))&&Ue(t.charCodeAt(r+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(r+2,r+6),16)),r+=5):Fe(r):x(r)}else Zn(t.charCodeAt(r))?S+=t[r]:T(t[r]);r++}return E(),r++,S}}function h(){const S=r;if(t.charCodeAt(r)===bs&&(r++,R(S)),t.charCodeAt(r)===ot)r++;else if(Yn(t.charCodeAt(r)))for(r++;De(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===ci)for(r++,R(S);De(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===fi||t.charCodeAt(r)===hi)for(r++,(t.charCodeAt(r)===bs||t.charCodeAt(r)===ii)&&r++,R(S);De(t.charCodeAt(r));)r++;if(r>S)return s(t.slice(S,r))}function b(){if(t.charCodeAt(r)!==ai)throw new SyntaxError(`Comma ',' expected after value ${q()}`);r++}function f(){if(t.charCodeAt(r)!==li)throw new SyntaxError(`Colon ':' expected after property name ${q()}`);r++}function w(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${q()}`)}function p(S){if(S===void 0)throw new SyntaxError(`Array item expected ${q()}`)}function I(){if(r<t.length)throw new SyntaxError(`Expected end of input ${q()}`)}function R(S){if(!De(t.charCodeAt(r))){const U=t.slice(S,r);throw new SyntaxError(`Invalid number '${U}', expecting a digit ${q()}`)}}function E(){if(t.charCodeAt(r)!==it)throw new SyntaxError(`End of string '"' expected ${q()}`)}function O(){throw new SyntaxError(`Quoted object key expected ${q()}`)}function V(S,U){throw new SyntaxError(`Duplicate key '${S}' encountered at position ${U}`)}function _(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${q()}`)}function j(){throw new SyntaxError(`Array item or end of array ']' expected ${q()}`)}function T(S){throw new SyntaxError(`Invalid character '${S}' ${J()}`)}function x(S){const U=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${U}' ${J()}`)}function L(){throw new SyntaxError(`Object value expected after ':' ${J()}`)}function Fe(S){const U=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${U}' ${J()}`)}function J(){return`at position ${r}`}function ae(){return r<t.length?`but got '${t[r]}'`:"but reached end of input"}function q(){return`${ae()} ${J()}`}}function Kn(t){return t===ti||t===si||t===ri||t===ni}function Ue(t){return t>=ot&&t<=at||t>=ui&&t<=pi||t>=di&&t<=mi}function De(t){return t>=ot&&t<=at}function Yn(t){return t>=oi&&t<=at}function Zn(t){return t>=32&&t<=1114111}function nt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,r)=>nt(s,e[r])):ps(t)&&ps(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>nt(t[s],e[s])):!1}function ps(t){return typeof t=="object"&&t!==null}const Gn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
+ `,r:"\r",t:" "},Xn=92,Qn=123,ms=125,ei=91,gs=93,ti=32,si=10,ri=9,ni=13,it=34,ii=43,bs=45,ot=48,oi=49,at=57,ai=44,ci=46,li=58,ui=65,di=97,hi=69,fi=101,pi=70,mi=102;function _s(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"||!ds(h))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${h})`);return h}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return i(l);if(l&&typeof l=="object")return o(l)}function i(l,u){if(l.length===0)return"[]";let d="[";for(let h=0;h<l.length;h++){const b=l[h];typeof b<"u"&&typeof b!="function"?d+=n(b):d+="null",h<l.length-1&&(d+=",")}return d+="]",d}function o(l,u){if(typeof l.toJSON=="function")return _s(l.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(l);if(d.length===0)return"{}";let h=!0,b="{";for(const f of d){const w=l[f];if(a(f,w)){h?h=!1:b+=",";const p=JSON.stringify(f);b+=`${p}:`,b+=n(w)}}return b+="}",b}function a(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function gi(t){return ge(t)&&!hs(t)?BigInt(t):parseFloat(t)}class ys{constructor(){Se(this,"id",1)}async exec(e,s,r={},n={},i=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 Qt.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:i,transformRequest:[(o,a)=>_s(o)],transformResponse:[o=>Hn(o,void 0,gi)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a=o,a}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,s){return this.exec("map_target_to_interface",[e,s])}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...r){return this.exec("interface_cmd",[e,s,...r])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,s,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 i=await this.exec("get_tlm_packet",[e,s],{type:r,stale_time:n});if(i!=null){let o=i.length,a=null;for(let l=0;l<o;l++)a=this.decode_openc3_type(i[l][1]),a!==null&&(i[l][1]=a)}return i}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,s=30,r=null,n=null,i=null){let o={stale_time:s};r!==null&&(o.cache_timeout=r),n!==null&&(o.start_time=n.toISOString()),i!==null&&(o.end_time=i.toISOString());const a=await this.exec("get_tlm_values",[e],o,{},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 i=null;if(s===void 0)i=await this.exec("tlm",[e]);else if(r===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))i=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else i=await this.exec("tlm",[e,s,r],{type:n});let o=this.decode_openc3_type(i);return o!==null&&(i=o),i}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,i,o={}){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],o,i)}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={},i={}){return s===void 0?this.exec("cmd",e,{},n):this._cmd("cmd",e,s,r,n,i)}cmd_no_range_check(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_no_range_check",e,{},n,i):this._cmd("cmd_no_range_check",e,s,r,n,i)}cmd_raw(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_raw",e,{},n,i):this._cmd("cmd_raw",e,s,r,n,i)}cmd_raw_no_range_check(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,{},n,i):this._cmd("cmd_raw_no_range_check",e,s,r,n,i)}cmd_no_hazardous_check(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,{},n,i):this._cmd("cmd_no_hazardous_check",e,s,r,n,i)}cmd_no_checks(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_no_checks",e,{},n,i):this._cmd("cmd_no_checks",e,s,r,n,i)}cmd_raw_no_hazardous_check(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},n,i):this._cmd("cmd_raw_no_hazardous_check",e,s,r,n,i)}cmd_raw_no_checks(e,s,r,n={},i={}){return s===void 0?this.exec("cmd_raw_no_checks",e,{},n,i):this._cmd("cmd_raw_no_checks",e,s,r,n,i)}build_cmd(e,s,r,n={},i={}){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,r,n,i)}build_command(e,s,r,n={},i={}){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,r,n,i)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,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(i=>i.toString(16).padStart(2,"0")).join("")}}}const bi={components:{ValueWidget:pt,ValuelimitsbarWidget:mt},mixins:[Be],props:{modelValue:{type:Array,default:()=>[]},timeZone:{type:String,default:"local"}},data(){return{api:null,cable:new us,ignored:[],ignoredItemsDialog:!1,overallState:"GREEN",currentLimitsSet:"",items:[],itemList:[],screenItems:[],screenValues:{},updateCounter:0,itemsPerPage:25,search:"",headers:[{title:"Timestamp",key:"timestamp",width:"130px",sortable:!0,nowrap:!0},{title:"Item",key:"item",value:t=>t.parameters[2],sortable:!0,minWidth:"100px",width:"200px",maxWidth:"300px"},{title:"Value",key:"value",width:"380px",sortable:!1},{title:"Controls",key:"actions",width:"80px",sortable:!1},{title:"",key:"limits",sortable:!1}],valueLimitsBarWidgetSettings:[["WIDTH","380px"],["0","WIDTH","200px"],["1","WIDTH","180px"]],valueWidgetSettings:[["WIDTH","200px"]]}},computed:{textFieldClass(){return this.overallState?`textfield-${this.overallState.toLowerCase()}`:""},overallStateFormatted(){return this.ignored.length===0?this.overallState:`${this.overallState} (Some items ignored)`},ignoredFormatted(){return this.ignored.map(t=>t.split("__").join(" "))},astroStatus(){switch(this.overallState){case"GREEN":return"normal";case"YELLOW":return"caution";case"RED":return"critical";case"BLUE":return"standby";default:return null}}},created(){this.api=new ys;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("__"),i=`${s}__${r}`;for(this.ignored.push(i),e||this.updateIgnored();;){let o=this.itemList.findIndex(a=>a.includes(i));if(o===-1)break;{let a=this.itemList[o].lastIndexOf("__");this.removeItem(this.itemList[o].substring(0,a))}}this.calcOverallState()},ignoreItem(t,e){this.ignored.push(t),e||this.updateIgnored(),this.removeItem(t),this.calcOverallState()},restoreItem(t){this.ignored.splice(t,1),this.updateIgnored(),this.updateOutOfLimits()},removeItem(t){const e=this.itemList.findIndex(s=>s.includes(t));this.items.splice(e,1),this.itemList.splice(e,1)},clearAll(){this.ignored=[],this.updateIgnored(),this.updateOutOfLimits()},updateIgnored(){this.$emit("update:modelValue",this.ignored)},handleConfigEvents(t){for(let e of t)e.kind==="deleted"&&e.type==="target"&&this.updateOutOfLimits()},handleMessages(t){for(let e of t){let s=JSON.parse(e.event);if(s.type!="LIMITS_CHANGE")continue;let r=`${s.target_name}__${s.packet_name}__${s.item_name}`;const n=this.itemList.findIndex(o=>o.includes(r));if(n!==-1){this.itemList[n]=`${r}__${s.new_limits_state}`,this.calcOverallState();continue}if(this.ignored.find(o=>r.includes(o))||s.new_limits_state&&!(s.new_limits_state.includes("YELLOW")||s.new_limits_state.includes("RED")))continue;let i={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"?i.limits=!1:i.limits=!0,this.itemList.push(`${r}__${s.new_limits_state}`),this.items.push(i),this.calcOverallState()}},update(){this.screenItems.length!==0&&this.api.get_tlm_values(this.screenItems).then(t=>{this.updateValues(t)})},updateValues:function(t){this.updateCounter+=1;for(let e=0;e<t.length;e++)t[e].push(this.updateCounter),this.screenValues[this.screenItems[e]]=t[e]},addItem:function(t){this.screenItems.push(t),this.screenValues[t]=[null,null,0]},deleteItem:function(t){let e=this.screenItems.indexOf(t);this.screenItems.splice(e,1)},showIgnored(){this.ignoredItemsDialog=!0},customFilter(t,e,s){if(!e||e.trim()==="")return!0;if(e=e.toLowerCase(),s.parameters&&s.parameters.length>0){for(const 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))}}},_i=["status"],yi={class:"font-weight-black"};function wi(t,e,s,r,n,i){const o=y("v-text-field"),a=y("v-spacer"),l=y("v-row"),u=y("valuelimitsbar-widget"),d=y("value-widget"),h=y("v-btn"),b=y("v-icon"),f=y("v-list-item-title"),w=y("v-list-item"),p=y("v-list"),I=y("v-menu"),R=y("v-data-table"),E=y("v-card"),O=y("v-toolbar"),V=y("v-divider"),_=y("v-card-text"),j=y("v-card-actions"),T=y("v-dialog");return k(),M("div",null,[g(E,{class:"pa-5"},{default:m(()=>[g(l,{class:"ma-1"},{default:m(()=>[g(o,{density:"compact",variant:"outlined",readonly:"","hide-details":"",label:"Overall Limits State","model-value":i.overallStateFormatted,class:qe(i.textFieldClass),style:{"margin-right":"10px","max-width":"280px"},"data-test":"overall-state"},ve({_:2},[i.astroStatus?{name:"prepend-inner",fn:m(()=>[F("rux-status",{status:i.astroStatus},null,8,_i)]),key:"0"}:void 0]),1032,["model-value","class"]),g(o,{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"]),g(a),g(o,{modelValue:n.search,"onUpdate:modelValue":e[0]||(e[0]=x=>n.search=x),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",style:{"max-width":"300px"},"data-test":"search"},null,8,["modelValue"])]),_:1}),g(R,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[1]||(e[1]=x=>n.itemsPerPage=x),headers:n.headers,items:n.items,search:n.search,"custom-filter":i.customFilter,"item-value":"key","data-test":"limits-table",class:"limits-table",density:"compact"},{"item.timestamp":m(({item:x})=>[P(H(x.timestamp),1)]),"item.value":m(({item:x})=>[x.limits?(k(),N(u,{key:0,parameters:x.parameters,settings:n.valueLimitsBarWidgetSettings,"screen-values":n.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"])):(k(),N(d,{key:1,parameters:x.parameters,settings:n.valueWidgetSettings,"screen-values":n.screenValues,"screen-time-zone":s.timeZone,onAddItem:i.addItem,onDeleteItem:i.deleteItem},null,8,["parameters","settings","screen-values","screen-time-zone","onAddItem","onDeleteItem"]))]),"item.actions":m(({item:x})=>[g(I,null,{activator:m(({props:L})=>[g(h,we({icon:"mdi-dots-horizontal",variant:"text",density:"compact","aria-label":"Item Options"},L),null,16)]),default:m(()=>[g(p,null,{default:m(()=>[g(w,{onClick:L=>i.ignorePacket(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>[...e[4]||(e[4]=[P("mdi-close-circle-multiple",-1)])]),_:1})]),default:m(()=>[g(f,null,{default:m(()=>[...e[5]||(e[5]=[P("Ignore Entire Packet",-1)])]),_:1})]),_:1},8,["onClick"]),g(w,{onClick:L=>i.ignoreItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>[...e[6]||(e[6]=[P("mdi-close-circle",-1)])]),_:1})]),default:m(()=>[g(f,null,{default:m(()=>[...e[7]||(e[7]=[P("Ignore Item",-1)])]),_:1})]),_:1},8,["onClick"]),g(w,{onClick:L=>i.removeItem(x.key)},{prepend:m(()=>[g(b,null,{default:m(()=>[...e[8]||(e[8]=[P("mdi-eye-off",-1)])]),_:1})]),default:m(()=>[g(f,null,{default:m(()=>[...e[9]||(e[9]=[P("Temporarily Hide Item",-1)])]),_:1})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]),"item.limits":m(({item:x})=>[g(a)]),_:1},8,["items-per-page","headers","items","search","custom-filter"]),e[10]||(e[10]=F("div",{class:"footer"},' Note: Timestamp is "now" for items currently out of limits when the page is loaded. ',-1))]),_:1}),g(T,{modelValue:n.ignoredItemsDialog,"onUpdate:modelValue":e[3]||(e[3]=x=>n.ignoredItemsDialog=x),"max-width":"600"},{default:m(()=>[g(E,null,{default:m(()=>[g(O,{height:"24"},{default:m(()=>[g(a),e[11]||(e[11]=F("span",null,"Ignored Items",-1)),g(a)]),_:1}),g(_,{class:"mt-2"},{default:m(()=>[F("div",null,[(k(!0),M(Y,null,re(i.ignoredFormatted,(x,L)=>(k(),M("div",{key:L},[g(l,{class:"ma-1 align-center"},{default:m(()=>[F("span",yi,H(x),1),g(a),g(h,{icon:"mdi-delete",density:"compact",variant:"text","aria-label":"Remove Ignored Item","data-test":`remove-ignore-${L}`,onClick:Fe=>i.restoreItem(L)},null,8,["data-test","onClick"])]),_:2},1024),L<i.ignoredFormatted.length-1?(k(),N(V,{key:L})):Z("",!0)]))),128))])]),_:1}),g(j,{class:"px-2"},{default:m(()=>[g(h,{variant:"outlined",onClick:i.clearAll},{default:m(()=>[...e[12]||(e[12]=[P(" Clear All ",-1)])]),_:1},8,["onClick"]),g(a),g(h,{variant:"flat",onClick:e[2]||(e[2]=x=>n.ignoredItemsDialog=!1)},{default:m(()=>[...e[13]||(e[13]=[P(" Ok ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const vi=ye(bi,[["render",wi],["__scopeId","data-v-ed7ec5ac"]]),Si={mixins:[Be],props:{historyCount:{type:Number,default:1e3},timeZone:{type:String,default:"local"}},data(){return{data:[],cable:new us,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}}},Ei=["status"];function xi(t,e,s,r,n,i){const o=y("v-spacer"),a=y("v-text-field"),l=y("v-card-title"),u=y("v-data-table"),d=y("v-card");return k(),N(d,{class:"card-height"},{default:m(()=>[g(l,{class:"d-flex align-center"},{default:m(()=>[e[1]||(e[1]=P(" Limits Events ",-1)),g(o),g(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}),g(u,{headers:n.headers,items:n.data,search:n.search,"items-per-page":-1,"hide-default-footer":"","multi-sort":"",density:"compact",height:i.calcTableHeight(),hover:"","data-test":"limits-events"},{"item.time_nsec":m(({item:h})=>[F("span",null,H(t.formatNanoseconds(h.time_nsec,s.timeZone)),1)]),"item.level":m(({item:h})=>[F("rux-status",{status:i.getStatus(h.message)},null,8,Ei)]),"item.message":m(({item:h})=>[F("span",{class:qe(i.getColorClass(h.message))},H(h.message),3)]),_:1},8,["headers","items","search","height"])]),_:1})}const Ci={components:{LimitsControl:vi,LimitsEvents:ye(Si,[["render",xi],["__scopeId","data-v-3c276116"]]),TopBar:Cs,OpenConfigDialog:ht,SaveConfigDialog:dt},mixins:[ut],data(){return{title:"Limits Monitor",configKey:"limits_monitor",api:new ys,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 Oi(t,e,s,r,n,i){const o=y("top-bar"),a=y("limits-control"),l=y("limits-events"),u=y("open-config-dialog"),d=y("save-config-dialog"),h=y("v-spacer"),b=y("v-toolbar"),f=y("v-select"),w=y("v-card-text"),p=y("v-btn"),I=y("v-card-actions"),R=y("v-card"),E=y("v-dialog");return k(),M("div",null,[g(o,{menus:n.menus,title:n.title},null,8,["menus","title"]),(k(),N(a,{ref:"control",key:n.renderKey,modelValue:n.ignored,"onUpdate:modelValue":e[0]||(e[0]=O=>n.ignored=O),"time-zone":n.timeZone},null,8,["modelValue","time-zone"])),e[11]||(e[11]=F("div",{style:{height:"15px"}},null,-1)),g(l,{"time-zone":n.timeZone},null,8,["time-zone"]),n.openConfig?(k(),N(u,{key:0,modelValue:n.openConfig,"onUpdate:modelValue":e[1]||(e[1]=O=>n.openConfig=O),"config-key":n.configKey,onSuccess:i.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):Z("",!0),n.saveConfig?(k(),N(d,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[2]||(e[2]=O=>n.saveConfig=O),"config-key":n.configKey,onSuccess:i.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):Z("",!0),g(E,{modelValue:n.limitsSetDialog,"onUpdate:modelValue":e[5]||(e[5]=O=>n.limitsSetDialog=O),"max-width":"650"},{default:m(()=>[g(R,null,{default:m(()=>[g(b,{height:"24"},{default:m(()=>[g(h),e[6]||(e[6]=F("span",null,"Change Limits Set",-1)),g(h)]),_:1}),g(w,{class:"mt-6"},{default:m(()=>[e[7]||(e[7]=F("span",{style:{display:"block"}}," The Limits Set is a global option which changes the Limits Set across all tools. ",-1)),e[8]||(e[8]=F("span",{style:{display:"block"}}," NOTE: Changing this option clears the current list and recalculates based on the new set. ",-1)),g(f,{modelValue:n.currentLimitsSet,"onUpdate:modelValue":e[3]||(e[3]=O=>n.currentLimitsSet=O),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}),g(I,{class:"px-2"},{default:m(()=>[g(h),g(p,{variant:"outlined",onClick:e[4]||(e[4]=O=>n.limitsSetDialog=!1)},{default:m(()=>[...e[9]||(e[9]=[P(" Cancel ",-1)])]),_:1}),g(p,{variant:"flat",onClick:i.setLimitsSet},{default:m(()=>[...e[10]||(e[10]=[P(" Ok ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const Wi=vs("default",ye(Ci,[["render",Oi]]))})}}));