openc3-cosmos-tool-cmdtlmserver 6.7.0 → 6.8.1

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 (155) hide show
  1. checksums.yaml +4 -4
  2. data/tools/cmdtlmserver/ArrayWidget-FGjLmPfG-683db8ebbd412ff5cf60.js +2 -0
  3. data/tools/cmdtlmserver/ArrayplotWidget-Cfo18TYm-c2c8c904050bb47be42d.js +1 -0
  4. data/tools/cmdtlmserver/BarColumn-BuJ6MTYG-cd72ee4fac54e0162c5b.js +1 -0
  5. data/tools/cmdtlmserver/BlockWidget-B_JwY8-N-4d0fd7f8eaf32c3149fa.js +2 -0
  6. data/tools/cmdtlmserver/ButtonWidget-Cd4M3aBD-c6e6ee5a4de20cee38c4.js +2 -0
  7. data/tools/cmdtlmserver/CanvasWidget-CpKdOgTG-e21cfaf765f87dc06820.js +1 -0
  8. data/tools/cmdtlmserver/CanvasdotWidget-zYbI5LAw-75b3ab3135056a71bd66.js +1 -0
  9. data/tools/cmdtlmserver/CanvasimageWidget--ORQEPj6-c58343b2fe7598056f45.js +1 -0
  10. data/tools/cmdtlmserver/CanvasimagevalueWidget-CtAtYHRm-70ebc4e8daa927c22814.js +1 -0
  11. data/tools/cmdtlmserver/CanvaslabelWidget-DWoROb6o-476ec50948cf48d49fbd.js +1 -0
  12. data/tools/cmdtlmserver/CanvaslabelvalueWidget-A4UbtwEc-1c361cc4b4b5146a5d33.js +1 -0
  13. data/tools/cmdtlmserver/CanvaslineWidget-BBGi0nrb-d4088e55a3153f2ccb95.js +1 -0
  14. data/tools/cmdtlmserver/CanvaslinevalueWidget-C_9OkL7f-ffe44fffbe9c6f58dd9e.js +1 -0
  15. data/tools/cmdtlmserver/CheckbuttonWidget-CTJg8Ypg-e7b7bf6b3dd279023328.js +1 -0
  16. data/tools/cmdtlmserver/CmdPacketsTab-f0bc4223a524614b062f.js +1 -0
  17. data/tools/cmdtlmserver/CmdTlmServer-bc76235d10c09682c6e2.js +2 -0
  18. data/tools/cmdtlmserver/ComboboxWidget-DWiMZZk8-656b04f7d9af94bd5d42.js +1 -0
  19. data/tools/cmdtlmserver/DateWidget-C7GSh68_-13f0f32ea6e8efc4871a.js +1 -0
  20. data/tools/cmdtlmserver/DetailsDialog-B2l0BNc2-9ae1d4713aeae76dbd5d.js +1 -0
  21. data/tools/cmdtlmserver/DynamicWidget-CfMtj7H8-925a3fc3c572312a55a3.js +1 -0
  22. data/tools/cmdtlmserver/FormatvalueWidget-CZJdsUAq-bb32367559b73c0909bc.js +1 -0
  23. data/tools/cmdtlmserver/Graph-DZBpdSgR-f56dde00f81280043da9.js +1 -0
  24. data/tools/cmdtlmserver/GraphWidget-CHm4bhMI-44dd778434539663613d.js +1 -0
  25. data/tools/cmdtlmserver/HorizontalWidget-B2skpV1m-b23f5fd3c367fd63ccd6.js +1 -0
  26. data/tools/cmdtlmserver/HorizontalboxWidget-BI0WZP5M-ee4fbb561897d0ecd67f.js +1 -0
  27. data/tools/cmdtlmserver/HorizontallineWidget-AmxVeXcU-288549f981a254098664.js +1 -0
  28. data/tools/cmdtlmserver/IframeWidget-DcqRMhyW-5e1bb93e1aa72c466dd2.js +1 -0
  29. data/tools/cmdtlmserver/ImageLoader-ly4zoGpO-b6ef72444fb0db18f0a6.js +1 -0
  30. data/tools/cmdtlmserver/ImageviewerWidget-cmDHcmW4-f29c44e7be2549619a02.js +1 -0
  31. data/tools/cmdtlmserver/InterfacesTab-ef2e279c2d974542fbb7.js +1 -0
  32. data/tools/cmdtlmserver/LabelWidget-Bemw8Erq-77bfb932644b19401509.js +1 -0
  33. data/tools/cmdtlmserver/LabelledWidget-Cb7EvtUG-21700e23054272de0cdf.js +1 -0
  34. data/tools/cmdtlmserver/LabelprogressbarWidget-qYgrGqLY-afe2e284394185569250.js +1 -0
  35. data/tools/cmdtlmserver/LabelsparklineWidget-CMklq9-f-89ac388088ab17b0d9b2.js +1 -0
  36. data/tools/cmdtlmserver/LabelvalueWidget-NjCMgiYL-c36a0b089904315582dd.js +1 -0
  37. data/tools/cmdtlmserver/LabelvaluedescWidget-Dflulqm7-b5d359d3b572346f63af.js +1 -0
  38. data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-M34NDk2S-e8550809276767a62c80.js +1 -0
  39. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-Cchaw_-k-8b4ee4b4717aaff157c9.js +1 -0
  40. data/tools/cmdtlmserver/LabelvaluerangebarWidget-7pEykAm3-5dfe07da7d1638b771d3.js +1 -0
  41. data/tools/cmdtlmserver/Layout-BNvQKlyy-42669883439252bc6d22.js +1 -0
  42. data/tools/cmdtlmserver/LedWidget-_EA7ZKM8-1787942a8f24943d5f0c.js +1 -0
  43. data/tools/cmdtlmserver/LimitsbarWidget-DdoQf46y-a99c661845df64dcf68d.js +1 -0
  44. data/tools/cmdtlmserver/LimitscolorWidget-Cv0umnVo-3ebe584cf417b4b72ad0.js +1 -0
  45. data/tools/cmdtlmserver/LimitscolumnWidget-CnCQtxim-7d2c6a4a3ac5022d2e6b.js +1 -0
  46. data/tools/cmdtlmserver/LinegraphWidget-ekyQoR7x-6ccbac58fdd534b9d86e.js +1 -0
  47. data/tools/cmdtlmserver/MatrixbycolumnsWidget-IBUcGNF7-6e6e8ca8f95b59321550.js +1 -0
  48. data/tools/cmdtlmserver/ProgressbarWidget-CnveFZVh-39dfa34c59474909f2f1.js +1 -0
  49. data/tools/cmdtlmserver/RadiobuttonWidget-hWLrCb8W-4267747702f7f998ed48.js +1 -0
  50. data/tools/cmdtlmserver/RadiogroupWidget-DK1fphkh-4240a6df70fa8dca51a1.js +1 -0
  51. data/tools/cmdtlmserver/RangebarWidget-vspY8CGV-ebdba021106feba919b8.js +1 -0
  52. data/tools/cmdtlmserver/RawDialog-2e14a913b76847da4ba9.js +11 -0
  53. data/tools/cmdtlmserver/RollupWidget-07pNcXQV-ba5e4005c086c12c06ec.js +1 -0
  54. data/tools/cmdtlmserver/RoutersTab-4a1f6189bc2c16e48e45.js +1 -0
  55. data/tools/cmdtlmserver/ScrollwindowWidget-BcbyrYUo-10281c7d6b14389eed73.js +1 -0
  56. data/tools/cmdtlmserver/SignalWidget-BDp5sUHj-a65e9d98e5ee38497414.js +1 -0
  57. data/tools/cmdtlmserver/SpacerWidget-DcOnQ1yI-85ede0dfdaf5332a75b5.js +1 -0
  58. data/tools/cmdtlmserver/SparklineWidget-CVglnlAm-70c13afcad82b1af8856.js +1 -0
  59. data/tools/cmdtlmserver/StatusTab-81f0151e31400a845091.js +1 -0
  60. data/tools/cmdtlmserver/TabbookWidget-p51Oa7Ru-5c77c55d3ca8c8eea2a2.js +1 -0
  61. data/tools/cmdtlmserver/TargetsTab-d315b150506412fd940d.js +1 -0
  62. data/tools/cmdtlmserver/TextboxWidget-DM-XX97e-a610e3330b16f7d8c357.js +1 -0
  63. data/tools/cmdtlmserver/TextfieldWidget-7cYHAgH8-cc633ee5c7fdc2827af2.js +1 -0
  64. data/tools/cmdtlmserver/TimeWidget-EvQJyu6x-8891f75d3167aa20e23f.js +1 -0
  65. data/tools/cmdtlmserver/TitleWidget-6ddfJuqd-3bbefc62c80d7df57c87.js +1 -0
  66. data/tools/cmdtlmserver/TlmPacketsTab-572f438a925f8dc917d2.js +1 -0
  67. data/tools/cmdtlmserver/Updater-7264a034babccd19df9b.js +1 -0
  68. data/tools/cmdtlmserver/VWidget-P-X9ffkl-c8b72dc1178eb3c8e2cd.js +1 -0
  69. data/tools/cmdtlmserver/ValueWidget-DAUGuQ9f-5aefd22f107264b78496.js +1 -0
  70. data/tools/cmdtlmserver/ValuelimitsbarWidget-DmLUXw0I-a8b62fb2384528e1f282.js +1 -0
  71. data/tools/cmdtlmserver/ValuelimitscolumnWidget-DDmo8wHJ-452d429087199fd8fd8f.js +1 -0
  72. data/tools/cmdtlmserver/ValuerangebarWidget-CbzWSWq3-36e7a304c66d8858de05.js +1 -0
  73. data/tools/cmdtlmserver/VerticalWidget-BuKinn_c-22586ad6fe541c906104.js +1 -0
  74. data/tools/cmdtlmserver/VerticalboxWidget-C0zD5h0O-b1a55e28b18d8849b8ef.js +1 -0
  75. data/tools/cmdtlmserver/Widget-BIXl-Pk5-d010324d778e54fd1761.js +1 -0
  76. data/tools/cmdtlmserver/main-465ec4b7b5416a57d004.js +1504 -0
  77. data/tools/cmdtlmserver/main.js +1 -1
  78. data/tools/cmdtlmserver/services-fc57b62f64eeefd0928c.js +7 -0
  79. metadata +78 -78
  80. data/tools/cmdtlmserver/ArrayWidget-BSG8KEtf-cbd5f5c949b5cf241afe.js +0 -2
  81. data/tools/cmdtlmserver/ArrayplotWidget-WVu76Kqn-8cd39f67f7c1ae9e478f.js +0 -1
  82. data/tools/cmdtlmserver/BarColumn-Cflh9pUz-1c7db00e85eff474d1a5.js +0 -1
  83. data/tools/cmdtlmserver/BlockWidget-B7ryWGCq-a4a3d485dfbf3ac7fa11.js +0 -2
  84. data/tools/cmdtlmserver/ButtonWidget-BKih3ix9-5d171b777c6a3a7c5a3f.js +0 -2
  85. data/tools/cmdtlmserver/CanvasWidget-DT9xMSfb-dbba02e1458989ff322d.js +0 -1
  86. data/tools/cmdtlmserver/CanvasdotWidget-7H5Hvcn--264b1fe9638e7001fa83.js +0 -1
  87. data/tools/cmdtlmserver/CanvasimageWidget-BbWYx6Gj-a5286b4d8bdb6aa2a68f.js +0 -1
  88. data/tools/cmdtlmserver/CanvasimagevalueWidget-Blvoe2X4-1cf9e0d30c3c2661ded0.js +0 -1
  89. data/tools/cmdtlmserver/CanvaslabelWidget-BPx_Rm4o-2bbe4d58b124595d0a79.js +0 -1
  90. data/tools/cmdtlmserver/CanvaslabelvalueWidget-DzdWvL0W-a6672cb874446440d60e.js +0 -1
  91. data/tools/cmdtlmserver/CanvaslineWidget-CqskilGk-279c69f4d2acb3a2a9bf.js +0 -1
  92. data/tools/cmdtlmserver/CanvaslinevalueWidget-C0JIKdvZ-e206d4d1c9a5b183e907.js +0 -1
  93. data/tools/cmdtlmserver/CheckbuttonWidget-C9FbJx2v-2f9b7e52ce874ec88e6f.js +0 -1
  94. data/tools/cmdtlmserver/CmdPacketsTab-76c7150a309c7370fedd.js +0 -1
  95. data/tools/cmdtlmserver/CmdTlmServer-3905c7ff0d71415031fe.js +0 -2
  96. data/tools/cmdtlmserver/ComboboxWidget-BbNKT0s8-f5960bfb563ec404dd90.js +0 -1
  97. data/tools/cmdtlmserver/DateWidget-CBMsdRUE-75130b14363dac262f69.js +0 -1
  98. data/tools/cmdtlmserver/DetailsDialog-DRVahE5z-9b92f2767e414098591b.js +0 -1
  99. data/tools/cmdtlmserver/DynamicWidget-CfMtj7H8-d95609758a30e674d5e3.js +0 -1
  100. data/tools/cmdtlmserver/FormatvalueWidget-BLWsqhIZ-edc31de79aa8740218ab.js +0 -1
  101. data/tools/cmdtlmserver/Graph-BiU56Qj2-54315d40edf483ba20b7.js +0 -1
  102. data/tools/cmdtlmserver/GraphWidget-Ga0AEfrJ-5d499fb644841b729647.js +0 -1
  103. data/tools/cmdtlmserver/HorizontalWidget-CsVhLwZO-4669f5ba5e312ae61672.js +0 -1
  104. data/tools/cmdtlmserver/HorizontalboxWidget-xC6PADl3-d4a26968ac07f7687ec6.js +0 -1
  105. data/tools/cmdtlmserver/HorizontallineWidget-NZIxmRVN-b0514a6724a5856ce5c5.js +0 -1
  106. data/tools/cmdtlmserver/IframeWidget-BgzjSfag-b44ad43e66c005281a3d.js +0 -1
  107. data/tools/cmdtlmserver/ImageLoader-DbFVK1Ui-aca69def5d95969b43d8.js +0 -1
  108. data/tools/cmdtlmserver/ImageviewerWidget-BnT5m-nw-d7fcf42c59ef29fea1b1.js +0 -1
  109. data/tools/cmdtlmserver/InterfacesTab-235fe81ace9605d0b904.js +0 -1
  110. data/tools/cmdtlmserver/LabelWidget-DSDYmz6X-2acdf9f316a1e9e3b696.js +0 -1
  111. data/tools/cmdtlmserver/LabelledWidget-DMb-myxs-35161504637a6200849e.js +0 -1
  112. data/tools/cmdtlmserver/LabelprogressbarWidget-CkjDJBao-1342d998d47befcc9620.js +0 -1
  113. data/tools/cmdtlmserver/LabelsparklineWidget-DBYPFz3Y-f24748082a23b8de528d.js +0 -1
  114. data/tools/cmdtlmserver/LabelvalueWidget-DlTkJC4i-829629548ba3c01ef0c4.js +0 -1
  115. data/tools/cmdtlmserver/LabelvaluedescWidget-dRqnGZub-989dd94dd3490c5d723a.js +0 -1
  116. data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-CS4NAPJ1-306529c0ebb2a7afeefb.js +0 -1
  117. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-D9x4Ppv8-bca2bd52454a15ecfda1.js +0 -1
  118. data/tools/cmdtlmserver/LabelvaluerangebarWidget-Dhyng4-n-714d06b2c473bd07d8a9.js +0 -1
  119. data/tools/cmdtlmserver/Layout-mWR35VAD-e550601c2ba102cf0978.js +0 -1
  120. data/tools/cmdtlmserver/LedWidget-D8cq4pUv-a186047e33924c8459fd.js +0 -1
  121. data/tools/cmdtlmserver/LimitsbarWidget-VGJnDuVM-25785045a2d5c4b13987.js +0 -1
  122. data/tools/cmdtlmserver/LimitscolorWidget-CG6Pqi12-e92368bd49f2e95c0ec0.js +0 -1
  123. data/tools/cmdtlmserver/LimitscolumnWidget-DjovQdiT-9b915e3fa359f72525f9.js +0 -1
  124. data/tools/cmdtlmserver/LinegraphWidget-DSWAhXgZ-4495e5932eb42cb20724.js +0 -1
  125. data/tools/cmdtlmserver/MatrixbycolumnsWidget-C3cuhRxz-a2518a76b1b006dd6832.js +0 -1
  126. data/tools/cmdtlmserver/ProgressbarWidget-oCgAEFBO-1b15827bd31abc8ec628.js +0 -1
  127. data/tools/cmdtlmserver/RadiobuttonWidget-D4Dak3lc-a5ebed47987e0428e1dc.js +0 -1
  128. data/tools/cmdtlmserver/RadiogroupWidget-Dbe9T4fp-1945e56ea701549baa60.js +0 -1
  129. data/tools/cmdtlmserver/RangebarWidget-CIVrgqrW-5e3ad9b627fc39a1a74a.js +0 -1
  130. data/tools/cmdtlmserver/RawDialog-9155547b67f8ddb4a1b7.js +0 -11
  131. data/tools/cmdtlmserver/RollupWidget-CH1-XNLV-5ae87244026dba1263ec.js +0 -1
  132. data/tools/cmdtlmserver/RoutersTab-79a5c3bc6e8a23dc39a2.js +0 -1
  133. data/tools/cmdtlmserver/ScrollwindowWidget-BwFG6Wn8-cd540c10bc1172173d6f.js +0 -1
  134. data/tools/cmdtlmserver/SignalWidget-Gz2gHrUm-8f42c62ed9c7c9daee50.js +0 -1
  135. data/tools/cmdtlmserver/SpacerWidget-Bg7VDB0k-61dce9792e33ada83be9.js +0 -1
  136. data/tools/cmdtlmserver/SparklineWidget-D_b5rfJv-6d9dcc78da498f3ea49b.js +0 -1
  137. data/tools/cmdtlmserver/StatusTab-cac15bc5c5ebfafbd8a1.js +0 -1
  138. data/tools/cmdtlmserver/TabbookWidget-C30f9B6z-54c4e96a7dd6322d638b.js +0 -1
  139. data/tools/cmdtlmserver/TargetsTab-f67dd6d498653319cf57.js +0 -1
  140. data/tools/cmdtlmserver/TextboxWidget-CDqxsgys-f7842c0af89400ad3c0b.js +0 -1
  141. data/tools/cmdtlmserver/TextfieldWidget-CAyjKJs6-b663ec33fa13b3935c34.js +0 -1
  142. data/tools/cmdtlmserver/TimeWidget-BQsP0G2X-aad85b8a4420b87e344d.js +0 -1
  143. data/tools/cmdtlmserver/TitleWidget-DXVba53S-48bdf9ab5f610a2dbbfb.js +0 -1
  144. data/tools/cmdtlmserver/TlmPacketsTab-f29e2bb217a5a6fdb3fa.js +0 -1
  145. data/tools/cmdtlmserver/Updater-2caaf27746e43f262f9a.js +0 -1
  146. data/tools/cmdtlmserver/VWidget-CFTCukCL-99bc49d1b235886d2c8a.js +0 -1
  147. data/tools/cmdtlmserver/ValueWidget-B-TWLPdM-951a8bd8d6aaeb5533c7.js +0 -1
  148. data/tools/cmdtlmserver/ValuelimitsbarWidget-jsDXdPdC-b4eb1145ace4ae5fcfb6.js +0 -1
  149. data/tools/cmdtlmserver/ValuelimitscolumnWidget-I-uwnXM2-8ae2729a548785b59fae.js +0 -1
  150. data/tools/cmdtlmserver/ValuerangebarWidget-OyhSTScu-9e9072d0b64f38559370.js +0 -1
  151. data/tools/cmdtlmserver/VerticalWidget-CkFbX1Gq-1a8932da2f05b6d41847.js +0 -1
  152. data/tools/cmdtlmserver/VerticalboxWidget-FEQgPM9r-18aba3a89fd11ea2653d.js +0 -1
  153. data/tools/cmdtlmserver/Widget-C3-TBgP7-bc82af910e32192fcc04.js +0 -1
  154. data/tools/cmdtlmserver/main-e0dc737e1cb81d554ebd.js +0 -1504
  155. data/tools/cmdtlmserver/services-a785d536ab3a733aa2d5.js +0 -7
@@ -1,7 +0,0 @@
1
- System.register([],function(Ee,Jn){"use strict";return{execute:function(){var Qt=Object.defineProperty,Yt=(t,e,r)=>e in t?Qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ie=(t,e,r)=>Yt(t,typeof e!="symbol"?e+"":e,r);function Ke(t,e){return function(){return t.apply(e,arguments)}}const{toString:Zt}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:oe,toStringTag:Xe}=Symbol,ce=(t=>e=>{const r=Zt.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),k=t=>(t=t.toLowerCase(),e=>ce(e)===t),ae=t=>e=>typeof e===t,{isArray:W}=Array,X=ae("undefined");function G(t){return t!==null&&!X(t)&&t.constructor!==null&&!X(t.constructor)&&R(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ge=k("ArrayBuffer");function er(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ge(t.buffer),e}const tr=ae("string"),R=ae("function"),Qe=ae("number"),Q=t=>t!==null&&typeof t=="object",rr=t=>t===!0||t===!1,le=t=>{if(ce(t)!=="object")return!1;const e=xe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Xe in t)&&!(oe in t)},sr=t=>{if(!Q(t)||G(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},nr=k("Date"),ir=k("File"),or=k("Blob"),cr=k("FileList"),ar=t=>Q(t)&&R(t.pipe),lr=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||R(t.append)&&((e=ce(t))==="formdata"||e==="object"&&R(t.toString)&&t.toString()==="[object FormData]"))},ur=k("URLSearchParams"),[hr,dr,fr,pr]=["ReadableStream","Request","Response","Headers"].map(k),gr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Y(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),W(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{if(G(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let c;for(s=0;s<o;s++)c=i[s],e.call(null,t[c],c,t)}}function Ye(t,e){if(G(t))return null;e=e.toLowerCase();const r=Object.keys(t);let s=r.length,n;for(;s-- >0;)if(n=r[s],e===n.toLowerCase())return n;return null}const $=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ze=t=>!X(t)&&t!==$;function Oe(){const{caseless:t}=Ze(this)&&this||{},e={},r=(s,n)=>{const i=t&&Ye(e,n)||n;le(e[i])&&le(s)?e[i]=Oe(e[i],s):le(s)?e[i]=Oe({},s):W(s)?e[i]=s.slice():e[i]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Y(arguments[s],r);return e}const mr=(t,e,r,{allOwnKeys:s}={})=>(Y(e,(n,i)=>{r&&R(n)?t[i]=Ke(n,r):t[i]=n},{allOwnKeys:s}),t),br=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yr=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},_r=(t,e,r,s)=>{let n,i,o;const c={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)o=n[i],(!s||s(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=r!==!1&&xe(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},wr=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},vr=t=>{if(!t)return null;if(W(t))return t;let e=t.length;if(!Qe(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Sr=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&xe(Uint8Array)),Er=(t,e)=>{const r=(t&&t[oe]).call(t);let s;for(;(s=r.next())&&!s.done;){const n=s.value;e.call(t,n[0],n[1])}},xr=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},Or=k("HTMLFormElement"),Rr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,r,s){return r.toUpperCase()+s}),et=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ar=k("RegExp"),tt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};Y(r,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(s[i]=o||n)}),Object.defineProperties(t,s)},Cr=t=>{tt(t,(e,r)=>{if(R(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const s=t[r];if(R(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Tr=(t,e)=>{const r={},s=n=>{n.forEach(i=>{r[i]=!0})};return W(t)?s(t):s(String(t).split(e)),r},kr=()=>{},Pr=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function jr(t){return!!(t&&R(t.append)&&t[Xe]==="FormData"&&t[oe])}const Ir=t=>{const e=new Array(10),r=(s,n)=>{if(Q(s)){if(e.indexOf(s)>=0)return;if(G(s))return s;if(!("toJSON"in s)){e[n]=s;const i=W(s)?[]:{};return Y(s,(o,c)=>{const u=r(o,n+1);!X(u)&&(i[c]=u)}),e[n]=void 0,i}}return s};return r(t,0)},Nr=k("AsyncFunction"),Lr=t=>t&&(Q(t)||R(t))&&R(t.then)&&R(t.catch),rt=((t,e)=>t?setImmediate:e?((r,s)=>($.addEventListener("message",({source:n,data:i})=>{n===$&&i===r&&s.length&&s.shift()()},!1),n=>{s.push(n),$.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",R($.postMessage)),Ur=typeof queueMicrotask<"u"?queueMicrotask.bind($):typeof process<"u"&&process.nextTick||rt,Fr=t=>t!=null&&R(t[oe]),a={isArray:W,isArrayBuffer:Ge,isBuffer:G,isFormData:lr,isArrayBufferView:er,isString:tr,isNumber:Qe,isBoolean:rr,isObject:Q,isPlainObject:le,isEmptyObject:sr,isReadableStream:hr,isRequest:dr,isResponse:fr,isHeaders:pr,isUndefined:X,isDate:nr,isFile:ir,isBlob:or,isRegExp:Ar,isFunction:R,isStream:ar,isURLSearchParams:ur,isTypedArray:Sr,isFileList:cr,forEach:Y,merge:Oe,extend:mr,trim:gr,stripBOM:br,inherits:yr,toFlatObject:_r,kindOf:ce,kindOfTest:k,endsWith:wr,toArray:vr,forEachEntry:Er,matchAll:xr,isHTMLForm:Or,hasOwnProperty:et,hasOwnProp:et,reduceDescriptors:tt,freezeMethods:Cr,toObjectSet:Tr,toCamelCase:Rr,noop:kr,toFiniteNumber:Pr,findKey:Ye,global:$,isContextDefined:Ze,isSpecCompliantForm:jr,toJSONObject:Ir,isAsyncFn:Nr,isThenable:Lr,setImmediate:rt,asap:Ur,isIterable:Fr};function m(t,e,r,s,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),r&&(this.config=r),s&&(this.request=s),n&&(this.response=n,this.status=n.status?n.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const st=m.prototype,nt={};["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=>{nt[t]={value:t}}),Object.defineProperties(m,nt),Object.defineProperty(st,"isAxiosError",{value:!0}),m.from=(t,e,r,s,n,i)=>{const o=Object.create(st);return a.toFlatObject(t,o,function(c){return c!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,t.message,e,r,s,n),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const $r=null;function Re(t){return a.isPlainObject(t)||a.isArray(t)}function it(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function ot(t,e,r){return t?t.concat(e).map(function(s,n){return s=it(s),!r&&n?"["+s+"]":s}).join(r?".":""):e}function qr(t){return a.isArray(t)&&!t.some(Re)}const Dr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ue(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,y){return!a.isUndefined(y[d])});const s=r.metaTokens,n=r.visitor||l,i=r.dots,o=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(n))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!c&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?c&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,y,f){let S=d;if(d&&!f&&typeof d=="object"){if(a.endsWith(y,"{}"))y=s?y:y.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&qr(d)||(a.isFileList(d)||a.endsWith(y,"[]"))&&(S=a.toArray(d)))return y=it(y),S.forEach(function(w,_){!(a.isUndefined(w)||w===null)&&e.append(o===!0?ot([y],_,i):o===null?y:y+"[]",u(w))}),!1}return Re(d)?!0:(e.append(ot(f,y,i),u(d)),!1)}const h=[],p=Object.assign(Dr,{defaultVisitor:l,convertValue:u,isVisitable:Re});function g(d,y){if(!a.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(d),a.forEach(d,function(f,S){(!(a.isUndefined(f)||f===null)&&n.call(e,f,a.isString(S)?S.trim():S,y,p))===!0&&g(f,y?y.concat(S):[S])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return g(t),e}function ct(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Ae(t,e){this._pairs=[],t&&ue(t,this,e)}const at=Ae.prototype;at.append=function(t,e){this._pairs.push([t,e])},at.toString=function(t){const e=t?function(r){return t.call(this,r,ct)}:ct;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function Br(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lt(t,e,r){if(!e)return t;const s=r&&r.encode||Br;a.isFunction(r)&&(r={serialize:r});const n=r&&r.serialize;let i;if(n?i=n(e,r):i=a.isURLSearchParams(e)?e.toString():new Ae(e,r).toString(s),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class ut{constructor(){this.handlers=[]}use(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}}const ht={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mr=typeof URLSearchParams<"u"?URLSearchParams:Ae,zr=typeof FormData<"u"?FormData:null,Jr=typeof Blob<"u"?Blob:null,Wr={isBrowser:!0,classes:{URLSearchParams:Mr,FormData:zr,Blob:Jr},protocols:["http","https","file","blob","url","data"]},Ce=typeof window<"u"&&typeof document<"u",Te=typeof navigator=="object"&&navigator||void 0,Hr=Ce&&(!Te||["ReactNative","NativeScript","NS"].indexOf(Te.product)<0),Vr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Kr=Ce&&window.location.href||"http://localhost",Xr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ce,hasStandardBrowserEnv:Hr,hasStandardBrowserWebWorkerEnv:Vr,navigator:Te,origin:Kr},Symbol.toStringTag,{value:"Module"})),x={...Xr,...Wr};function Gr(t,e){return ue(t,new x.classes.URLSearchParams,{visitor:function(r,s,n,i){return x.isNode&&a.isBuffer(r)?(this.append(s,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Qr(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Yr(t){const e={},r=Object.keys(t);let s;const n=r.length;let i;for(s=0;s<n;s++)i=r[s],e[i]=t[i];return e}function dt(t){function e(r,s,n,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),u=i>=r.length;return o=!o&&a.isArray(n)?n.length:o,u?(a.hasOwnProp(n,o)?n[o]=[n[o],s]:n[o]=s,!c):((!n[o]||!a.isObject(n[o]))&&(n[o]=[]),e(r,s,n[o],i)&&a.isArray(n[o])&&(n[o]=Yr(n[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const r={};return a.forEachEntry(t,(s,n)=>{e(Qr(s),n,r,0)}),r}return null}function Zr(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const Z={transitional:ht,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",s=r.indexOf("application/json")>-1,n=a.isObject(t);if(n&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(dt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gr(t,this.formSerializer).toString();if((i=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ue(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return n||s?(e.setContentType("application/json",!1),Zr(t)):t}],transformResponse:[function(t){const e=this.transitional||Z.transitional,r=e&&e.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const n=!(e&&e.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(i){if(n)throw i.name==="SyntaxError"?m.from(i,m.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:x.classes.FormData,Blob:x.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{Z.headers[t]={}});const es=a.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"]),ts=t=>{const e={};let r,s,n;return t&&t.split(`
2
- `).forEach(function(i){n=i.indexOf(":"),r=i.substring(0,n).trim().toLowerCase(),s=i.substring(n+1).trim(),!(!r||e[r]&&es[r])&&(r==="set-cookie"?e[r]?e[r].push(s):e[r]=[s]:e[r]=e[r]?e[r]+", "+s:s)}),e},ft=Symbol("internals");function ee(t){return t&&String(t).trim().toLowerCase()}function he(t){return t===!1||t==null?t:a.isArray(t)?t.map(he):String(t)}function rs(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const ss=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ke(t,e,r,s,n){if(a.isFunction(s))return s.call(this,e,r);if(n&&(e=r),!!a.isString(e)){if(a.isString(s))return e.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(e)}}function ns(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function is(t,e){const r=a.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{value:function(n,i,o){return this[s].call(this,e,n,i,o)},configurable:!0})})}let A=class{constructor(t){t&&this.set(t)}set(t,e,r){const s=this;function n(o,c,u){const l=ee(c);if(!l)throw new Error("header name must be a non-empty string");const h=a.findKey(s,l);(!h||s[h]===void 0||u===!0||u===void 0&&s[h]!==!1)&&(s[h||c]=he(o))}const i=(o,c)=>a.forEach(o,(u,l)=>n(u,l,c));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(a.isString(t)&&(t=t.trim())&&!ss(t))i(ts(t),e);else if(a.isObject(t)&&a.isIterable(t)){let o={},c,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");o[u=l[0]]=(c=o[u])?a.isArray(c)?[...c,l[1]]:[c,l[1]]:l[1]}i(o,e)}else t!=null&&n(e,t,r);return this}get(t,e){if(t=ee(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!e)return s;if(e===!0)return rs(s);if(a.isFunction(e))return e.call(this,s,r);if(a.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ee(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!e||ke(this,this[r],r,e)))}return!1}delete(t,e){const r=this;let s=!1;function n(i){if(i=ee(i),i){const o=a.findKey(r,i);o&&(!e||ke(r,r[o],o,e))&&(delete r[o],s=!0)}}return a.isArray(t)?t.forEach(n):n(t),s}clear(t){const e=Object.keys(this);let r=e.length,s=!1;for(;r--;){const n=e[r];(!t||ke(this,this[n],n,t,!0))&&(delete this[n],s=!0)}return s}normalize(t){const e=this,r={};return a.forEach(this,(s,n)=>{const i=a.findKey(r,n);if(i){e[i]=he(s),delete e[n];return}const o=t?ns(n):String(n).trim();o!==n&&delete e[n],e[o]=he(s),r[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(e[s]=t&&a.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
3
- `)}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 r=new this(t);return e.forEach(s=>r.set(s)),r}static accessor(t){const e=(this[ft]=this[ft]={accessors:{}}).accessors,r=this.prototype;function s(n){const i=ee(n);e[i]||(is(r,n),e[i]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(A.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),a.freezeMethods(A);function Pe(t,e){const r=this||Z,s=e||r,n=A.from(s.headers);let i=s.data;return a.forEach(t,function(o){i=o.call(r,i,n.normalize(),e?e.status:void 0)}),n.normalize(),i}function pt(t){return!!(t&&t.__CANCEL__)}function H(t,e,r){m.call(this,t??"canceled",m.ERR_CANCELED,e,r),this.name="CanceledError"}a.inherits(H,m,{__CANCEL__:!0});function gt(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function os(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function cs(t,e){t=t||10;const r=new Array(t),s=new Array(t);let n=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),l=s[i];o||(o=u),r[n]=c,s[n]=u;let h=i,p=0;for(;h!==n;)p+=r[h++],h=h%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),u-o<e)return;const g=l&&u-l;return g?Math.round(p*1e3/g):void 0}}function as(t,e){let r=0,s=1e3/e,n,i;const o=(c,u=Date.now())=>{r=u,n=null,i&&(clearTimeout(i),i=null),t(...c)};return[(...c)=>{const u=Date.now(),l=u-r;l>=s?o(c,u):(n=c,i||(i=setTimeout(()=>{i=null,o(n)},s-l)))},()=>n&&o(n)]}const de=(t,e,r=3)=>{let s=0;const n=cs(50,250);return as(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,u=o-s,l=n(u),h=o<=c;s=o;const p={loaded:o,total:c,progress:c?o/c:void 0,bytes:u,rate:l||void 0,estimated:l&&c&&h?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(p)},r)},mt=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},bt=t=>(...e)=>a.asap(()=>t(...e)),ls=x.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,x.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(x.origin),x.navigator&&/(msie|trident)/i.test(x.navigator.userAgent)):()=>!0,us=x.hasStandardBrowserEnv?{write(t,e,r,s,n,i){const o=[t+"="+encodeURIComponent(e)];a.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),a.isString(s)&&o.push("path="+s),a.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 hs(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function ds(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function yt(t,e,r){let s=!hs(e);return t&&(s||r==!1)?ds(t,e):e}const _t=t=>t instanceof A?{...t}:t;function q(t,e){e=e||{};const r={};function s(l,h,p,g){return a.isPlainObject(l)&&a.isPlainObject(h)?a.merge.call({caseless:g},l,h):a.isPlainObject(h)?a.merge({},h):a.isArray(h)?h.slice():h}function n(l,h,p,g){if(a.isUndefined(h)){if(!a.isUndefined(l))return s(void 0,l,p,g)}else return s(l,h,p,g)}function i(l,h){if(!a.isUndefined(h))return s(void 0,h)}function o(l,h){if(a.isUndefined(h)){if(!a.isUndefined(l))return s(void 0,l)}else return s(void 0,h)}function c(l,h,p){if(p in e)return s(l,h);if(p in t)return s(void 0,l)}const u={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:c,headers:(l,h,p)=>n(_t(l),_t(h),p,!0)};return a.forEach(Object.keys({...t,...e}),function(l){const h=u[l]||n,p=h(t[l],e[l],l);a.isUndefined(p)&&h!==c||(r[l]=p)}),r}const wt=t=>{const e=q({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:i,headers:o,auth:c}=e;e.headers=o=A.from(o),e.url=lt(yt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(a.isFormData(r)){if(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[l,...h]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...h].join("; "))}}if(x.hasStandardBrowserEnv&&(s&&a.isFunction(s)&&(s=s(e)),s||s!==!1&&ls(e.url))){const l=n&&i&&us.read(i);l&&o.set(n,l)}return e},fs=typeof XMLHttpRequest<"u",ps=fs&&function(t){return new Promise(function(e,r){const s=wt(t);let n=s.data;const i=A.from(s.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:u}=s,l,h,p,g,d;function y(){g&&g(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let f=new XMLHttpRequest;f.open(s.method.toUpperCase(),s.url,!0),f.timeout=s.timeout;function S(){if(!f)return;const _=A.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),T={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:_,config:t,request:f};gt(function(L){e(L),y()},function(L){r(L),y()},T),f=null}"onloadend"in f?f.onloadend=S:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(S)},f.onabort=function(){f&&(r(new m("Request aborted",m.ECONNABORTED,t,f)),f=null)},f.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const T=s.transitional||ht;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new m(_,T.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,f)),f=null},n===void 0&&i.setContentType(null),"setRequestHeader"in f&&a.forEach(i.toJSON(),function(_,T){f.setRequestHeader(T,_)}),a.isUndefined(s.withCredentials)||(f.withCredentials=!!s.withCredentials),o&&o!=="json"&&(f.responseType=s.responseType),u&&([p,d]=de(u,!0),f.addEventListener("progress",p)),c&&f.upload&&([h,g]=de(c),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(l=_=>{f&&(r(!_||_.type?new H(null,t,f):_),f.abort(),f=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const w=os(s.url);if(w&&x.protocols.indexOf(w)===-1){r(new m("Unsupported protocol "+w+":",m.ERR_BAD_REQUEST,t));return}f.send(n||null)})},gs=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,n;const i=function(l){if(!n){n=!0,c();const h=l instanceof Error?l:this.reason;s.abort(h instanceof m?h:new H(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,i(new m(`timeout ${e} of ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:u}=s;return u.unsubscribe=()=>a.asap(c),u}},ms=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,n;for(;s<r;)n=s+e,yield t.slice(s,n),s=n},bs=async function*(t,e){for await(const r of ys(t))yield*ms(r,e)},ys=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},vt=(t,e,r,s)=>{const n=bs(t,e);let i=0,o,c=u=>{o||(o=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:l,value:h}=await n.next();if(l){c(),u.close();return}let p=h.byteLength;if(r){let g=i+=p;r(g)}u.enqueue(new Uint8Array(h))}catch(l){throw c(l),l}},cancel(u){return c(u),n.return()}},{highWaterMark:2})},fe=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",St=fe&&typeof ReadableStream=="function",_s=fe&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Et=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ws=St&&Et(()=>{let t=!1;const e=new Request(x.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),xt=64*1024,je=St&&Et(()=>a.isReadableStream(new Response("").body)),pe={stream:je&&(t=>t.body)};fe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!pe[e]&&(pe[e]=a.isFunction(t[e])?r=>r[e]():(r,s)=>{throw new m(`Response type '${e}' is not supported`,m.ERR_NOT_SUPPORT,s)})})})(new Response);const vs=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(x.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await _s(t)).byteLength},Ss=async(t,e)=>a.toFiniteNumber(t.getContentLength())??vs(e),Es=fe&&(async t=>{let{url:e,method:r,data:s,signal:n,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:u,responseType:l,headers:h,withCredentials:p="same-origin",fetchOptions:g}=wt(t);l=l?(l+"").toLowerCase():"text";let d=gs([n,i&&i.toAbortSignal()],o),y;const f=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let S;try{if(u&&ws&&r!=="get"&&r!=="head"&&(S=await Ss(h,s))!==0){let O=new Request(e,{method:"POST",body:s,duplex:"half"}),N;if(a.isFormData(s)&&(N=O.headers.get("content-type"))&&h.setContentType(N),O.body){const[z,F]=mt(S,de(bt(u)));s=vt(O.body,xt,z,F)}}a.isString(p)||(p=p?"include":"omit");const w="credentials"in Request.prototype;y=new Request(e,{...g,signal:d,method:r.toUpperCase(),headers:h.normalize().toJSON(),body:s,duplex:"half",credentials:w?p:void 0});let _=await fetch(y,g);const T=je&&(l==="stream"||l==="response");if(je&&(c||T&&f)){const O={};["status","statusText","headers"].forEach(U=>{O[U]=_[U]});const N=a.toFiniteNumber(_.headers.get("content-length")),[z,F]=c&&mt(N,de(bt(c),!0))||[];_=new Response(vt(_.body,xt,z,()=>{F&&F(),f&&f()}),O)}l=l||"text";let L=await pe[a.findKey(pe,l)||"text"](_,t);return!T&&f&&f(),await new Promise((O,N)=>{gt(O,N,{data:L,headers:A.from(_.headers),status:_.status,statusText:_.statusText,config:t,request:y})})}catch(w){throw f&&f(),w&&w.name==="TypeError"&&/Load failed|fetch/i.test(w.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,t,y),{cause:w.cause||w}):m.from(w,w&&w.code,t,y)}}),Ie={http:$r,xhr:ps,fetch:Es};a.forEach(Ie,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ot=t=>`- ${t}`,xs=t=>a.isFunction(t)||t===null||t===!1,Rt={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let r,s;const n={};for(let i=0;i<e;i++){r=t[i];let o;if(s=r,!xs(r)&&(s=Ie[(o=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${o}'`);if(s)break;n[o||"#"+i]=s}if(!s){const i=Object.entries(n).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
4
- `+i.map(Ot).join(`
5
- `):" "+Ot(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:Ie};function Ne(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new H(null,t)}function At(t){return Ne(t),t.headers=A.from(t.headers),t.data=Pe.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Rt.getAdapter(t.adapter||Z.adapter)(t).then(function(e){return Ne(t),e.data=Pe.call(t,t.transformResponse,e),e.headers=A.from(e.headers),e},function(e){return pt(e)||(Ne(t),e&&e.response&&(e.response.data=Pe.call(t,t.transformResponse,e.response),e.response.headers=A.from(e.response.headers))),Promise.reject(e)})}const Ct="1.11.0",ge={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ge[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Tt={};ge.transitional=function(t,e,r){function s(n,i){return"[Axios v"+Ct+"] Transitional option '"+n+"'"+i+(r?". "+r:"")}return(n,i,o)=>{if(t===!1)throw new m(s(i," has been removed"+(e?" in "+e:"")),m.ERR_DEPRECATED);return e&&!Tt[i]&&(Tt[i]=!0,console.warn(s(i," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,i,o):!0}},ge.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Os(t,e,r){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let n=s.length;for(;n-- >0;){const i=s[n],o=e[i];if(o){const c=t[i],u=c===void 0||o(c,i,t);if(u!==!0)throw new m("option "+i+" must be "+u,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const me={assertOptions:Os,validators:ge},I=me.validators;let D=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ut,response:new ut}}async request(t,e){try{return await this._request(t,e)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const n=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?n&&!String(r.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+n):r.stack=n}catch{}}throw r}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=q(this.defaults,e);const{transitional:r,paramsSerializer:s,headers:n}=e;r!==void 0&&me.assertOptions(r,{silentJSONParsing:I.transitional(I.boolean),forcedJSONParsing:I.transitional(I.boolean),clarifyTimeoutError:I.transitional(I.boolean)},!1),s!=null&&(a.isFunction(s)?e.paramsSerializer={serialize:s}:me.assertOptions(s,{encode:I.function,serialize:I.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),me.assertOptions(e,{baseUrl:I.spelling("baseURL"),withXsrfToken:I.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=n&&a.merge(n.common,n[e.method]);n&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete n[d]}),e.headers=A.concat(i,n);const o=[];let c=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(e)===!1||(c=c&&d.synchronous,o.unshift(d.fulfilled,d.rejected))});const u=[];this.interceptors.response.forEach(function(d){u.push(d.fulfilled,d.rejected)});let l,h=0,p;if(!c){const d=[At.bind(this),void 0];for(d.unshift(...o),d.push(...u),p=d.length,l=Promise.resolve(e);h<p;)l=l.then(d[h++],d[h++]);return l}p=o.length;let g=e;for(h=0;h<p;){const d=o[h++],y=o[h++];try{g=d(g)}catch(f){y.call(this,f);break}}try{l=At.call(this,g)}catch(d){return Promise.reject(d)}for(h=0,p=u.length;h<p;)l=l.then(u[h++],u[h++]);return l}getUri(t){t=q(this.defaults,t);const e=yt(t.baseURL,t.url,t.allowAbsoluteUrls);return lt(e,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){D.prototype[t]=function(e,r){return this.request(q(r||{},{method:t,url:e,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function e(r){return function(s,n,i){return this.request(q(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}D.prototype[t]=e(),D.prototype[t+"Form"]=e(!0)});let Rs=class Gt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});const s=this;this.promise.then(n=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](n);s._listeners=null}),this.promise.then=n=>{let i;const o=new Promise(c=>{s.subscribe(c),i=c}).then(n);return o.cancel=function(){s.unsubscribe(i)},o},e(function(n,i,o){s.reason||(s.reason=new H(n,i,o),r(s.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Gt(function(r){e=r}),cancel:e}}};function As(t){return function(e){return t.apply(null,e)}}function Cs(t){return a.isObject(t)&&t.isAxiosError===!0}const Le={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(Le).forEach(([t,e])=>{Le[e]=t});function kt(t){const e=new D(t),r=Ke(D.prototype.request,e);return a.extend(r,D.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return kt(q(t,s))},r}const v=kt(Z);v.Axios=D,v.CanceledError=H,v.CancelToken=Rs,v.isCancel=pt,v.VERSION=Ct,v.toFormData=ue,v.AxiosError=m,v.Cancel=v.CanceledError,v.all=function(t){return Promise.all(t)},v.spread=As,v.isAxiosError=Cs,v.mergeConfig=q,v.AxiosHeaders=A,v.formToJSON=t=>dt(a.isHTMLForm(t)?new FormData(t):t),v.getAdapter=Rt.getAdapter,v.HttpStatusCode=Le,v.default=v;const{Axios:Wn,AxiosError:Hn,CanceledError:Vn,isCancel:Kn,CancelToken:Xn,VERSION:Gn,all:Qn,Cancel:Yn,isAxiosError:Zn,spread:ei,toFormData:ti,AxiosHeaders:ri,HttpStatusCode:si,formToJSON:ni,getAdapter:ii,mergeConfig:oi}=v,Ue=v.create({baseURL:location.origin,timeout:6e4,params:{}});Ue.interceptors.response.use(t=>t,t=>{var e,r,s,n,i,o,c,u,l,h,p;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(y){y&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let g=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(g+=`${t.response.statusText} `),(s=(r=t.response)==null?void 0:r.config)!=null&&s.data&&(g+=`${t.response.config.data} `),(i=(n=t.response)==null?void 0:n.data)!=null&&i.message?g+=`${t.response.data.message}`:(c=(o=t.response)==null?void 0:o.data)!=null&&c.exception?g+=`${t.response.data.exception}`:(h=(l=(u=t.response)==null?void 0:u.data)==null?void 0:l.error)!=null&&h.message?(t.response.data.error.class&&(g+=`${t.response.data.error.class} `),g+=`${t.response.data.error.message}`):g+=`${(p=t.response)==null?void 0:p.data}`;const{$cosmosNotify:d}=window;throw d&&d.serious({title:"Network error",body:g}),t}else throw t});const be=async function(t,e,{data:r,params:s={},headers:n,noAuth:i=!1,noScope:o=!1,onUploadProgress:c=!1}={}){if(!i){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}n.Authorization=localStorage.openc3Token}return n.manual=!0,!o&&!s.scope&&(s.scope=window.openc3Scope),Ue({method:t,url:e,data:r,params:s,headers:n,onUploadProgress:c})},Fe={Accept:"application/json"},Pt={...Fe,"Content-Type":"application/json"},ci=Ee("c",{get:function(t,{params:e,headers:r=Fe,noScope:s,noAuth:n,onUploadProgress:i}={}){return be("get",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:i})},put:function(t,{data:e,params:r,headers:s=Pt,noScope:n,noAuth:i,onUploadProgress:o}={}){return be("put",t,{data:e,params:r,headers:s,noScope:n,noAuth:i,onUploadProgress:o})},post:function(t,{data:e,params:r,headers:s=Pt,noScope:n,noAuth:i,onUploadProgress:o}={}){return be("post",t,{data:e,params:r,headers:s,noScope:n,noAuth:i,onUploadProgress:o})},delete:function(t,{params:e,headers:r=Fe,noScope:s,noAuth:n,onUploadProgress:i}={}){return be("delete",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:i})}});let ye=()=>({emit(t,...e){for(let r=this.events[t]||[],s=0,n=r.length;s<n;s++)r[s](...e)},events:{},on(t,e){var r;return((r=this.events)[t]||(r[t]=[])).push(e),()=>{var s;this.events[t]=(s=this.events[t])==null?void 0:s.filter(n=>e!==n)}}});class te extends Error{constructor(e,r){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=r,this.name="ReasonError"}}class $e extends te{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Ts extends te{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class P extends te{constructor(e,r){r?super(e,r):super("Disconnected",e),this.name="DisconnectedError"}}class ks extends P{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function jt(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let r=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${r}`}).join(",")}}`:""}class Ps{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,r){if(!this._info)return this._info={id:e,info:r},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((r,{id:s,info:n})=>(r[s]=n,r),{})}}const B=Symbol("state");class It{constructor(e={}){this.emitter=ye(),this.params=Object.freeze(e),this.presence=new Ps(this),this.initialConnect=!0,this[B]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=jt({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[B]}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[B]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[B]="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[B]="connected";let e=!0,r=!0;this.initialConnect=!1,this.emit("connect",{reconnect:r,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[B]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[B]="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,r){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,r)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(r){let s=this.receiver?this.receiver.logger:null;s&&s.warn("whisper failed: ",r)}}receive(e,r){this.emit("message",e,r)}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}emit(e,...r){return this.emitter.emit(e,...r)}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,r)=>{let s=[()=>delete this._pendingSubscribe];s.push(this.on("connect",()=>{s.forEach(n=>n()),e()})),s.push(this.on("close",n=>{s.forEach(i=>i()),r(n||new te("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class js{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 r=this.channels.indexOf(e);r>-1&&this.channels.splice(r,1)}notify(e,...r){this.state=e==="restored"?"connected":e,r.length===1?this.channels.forEach(s=>s[e](r[0])):this.channels.forEach(s=>s[e]())}pending(e){this._checkIntent(e);let r=this._pendings[0];return!r||r.intent!==e?Promise.resolve():r.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 r,s={promise:new Promise(i=>{r=i}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(s),1),r(s)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(s),n&&await n.promise,this.gvl&&await this.gvl.acquire(s,e),s.acquired=!0,s}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 r=this._pendingTop;return!r||r.acquired||r.intent!==e?!1:(this._pendings.pop(),r.canceled=!0,!0)}}class Is{constructor(){this.queue=[]}async acquire(e,r){r==="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 Ns{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new Is),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:r,unsubscribe:s}){let n=this._subscriptions[e]=new js(e);return n.remoteId=this._localToRemote[e],n.subscriber=r,n.unsubscriber=s,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,r){this._localToRemote[e]=r;let s=this.get(e);s&&(s.remoteId=r)}}class Ls{constructor(e={}){this.subscriptions=new Ns(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,r){this._remoteToLocal[r]=e,this.subscriptions.storeRemoteId(e,r),this.flush(r)}unsubscribe(e){let r=this.subscriptions.get(e);if(!r)return;let s=r.remoteId;s&&delete this._remoteToLocal[s],this.subscriptions.remove(e)}transmit(e,r,s){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,r,s]);return}let i=this.subscriptions.get(n);i&&i.channels.forEach(o=>{o.receive(r,s)})}notify(e,r,s){let n=this._remoteToLocal[e];if(!n)return;let i=this.subscriptions.get(n);i&&i.channels.forEach(o=>o.emit(r,s))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let r=[];for(let s of this._pendingMessages)s[0]===e?this.transmit(s[0],s[1],s[2]):r.push(s);this._pendingMessages=r}}const Nt={debug:0,info:1,warn:2,error:3};class Lt{constructor(e){this.level=e||"warn"}log(e,r,s){Nt[e]<Nt[this.level]||this.writeLogEntry(e,r,s)}writeLogEntry(){throw Error("Not implemented")}debug(e,r){this.log("debug",e,r)}info(e,r){this.log("info",e,r)}warn(e,r){this.log("warn",e,r)}error(e,r){this.log("error",e,r)}}class re extends Lt{writeLogEntry(){}}class Us{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Fs=0;class Ut{constructor(e={}){let{logger:r}=e;this.logger=r||new re,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,r){let s={channel:e};r&&Object.assign(s,r);let n=jt(s);if(this.pendingUnsubscriptions[n]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,n),new Promise(c=>{setTimeout(()=>{c(this.subscribe(e,r))},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,c)=>{let u=++Fs;this.pendingSubscriptions[n]={resolve:o,reject:c,id:u},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(u,n,i)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${s}ms, retrying subscribe`,r),this.cable.send(this.buildSubscribeRequest(r)),this.maybeExpireSubscribe(e,r,s))},s)}maybeExpireSubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(delete this.pendingSubscriptions[r],n.reject(new Ts(`Haven't received subscription ack in ${s*2}ms for ${r}`)))},s)}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,r,s){return r==="$whisper"?this.whisper(e,s):(s||(s={}),s.action=r,this.cable.send({command:"message",identifier:e,data:JSON.stringify(s)}),Promise.resolve())}whisper(e,r){return this.cable.send({command:"whisper",identifier:e,data:r}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n,reason:i,reconnect:o}=e;if(r==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="welcome"){let c=e.sid;return c&&this.cable.setSessionId(c),this.cable.connected()}if(r==="disconnect"){let c=new P(i);this.reset(c),o===!1?this.cable.closed(c):this.cable.disconnected(c);return}if(r==="confirm_subscription"){let c=this.pendingSubscriptions[s];if(!c){this.logger.error("subscription not found, unsubscribing",{type:r,identifier:s}),this.unsubscribe(s);return}return delete this.pendingSubscriptions[s],c.resolve(s)}if(r==="reject_subscription"){let c=this.pendingSubscriptions[s];return c?(delete this.pendingSubscriptions[s],c.reject(new $e)):this.logger.error("subscription not found",{type:r,identifier:s})}if(n)return{identifier:s,message:n};this.logger.warn(`unknown message type: ${r}`,{message:e})}reset(e){for(let r in this.pendingSubscriptions)this.pendingSubscriptions[r].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const Ft=()=>Date.now()/1e3|0;class $s extends Ut{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=Ft()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let r in this.pendingPresence)this.pendingPresence[r].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n}=e;if(r==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(r==="reject_subscription")return super.receive(e);if(r==="confirm_subscription")return this.subscriptionStreams[s]||(this.subscriptionStreams[s]=new Set),super.receive(e);if(r==="ping")return this.restoreSince&&(this.restoreSince=Ft()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",s);return}if(r==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",s);return}if(r==="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(r==="presence"){let i=n.type;if(i==="info"){let o=this.pendingPresence[s];o&&(delete this.pendingPresence[s],o.resolve(n))}else if(i==="error"){let o=this.pendingPresence[s];o&&(delete this.pendingPresence[s],o.reject(new Error("failed to retrieve presence")))}return{type:r,identifier:s,message:n}}if(n){let i=this.trackStreamPosition(s,e.stream_id,e.epoch,e.offset);return{identifier:s,message:n,meta:i}}this.logger.warn(`unknown message type: ${r}`,{message:e})}perform(e,r,s){switch(r){case"$presence:join":return this.join(e,s);case"$presence:leave":return this.leave(e,s);case"$presence:info":return this.presence(e,s)}return super.perform(e,r,s)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let r=super.buildSubscribeRequest(e),s=this.historyRequestFor(e);s&&(r.history=s,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(r.presence=n),r}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let r={},s=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let i=this.streamsPositions[n];i&&(s=!0,r[n]=i)}if(!(!s&&!this.restoreSince))return{since:this.restoreSince,streams:r}}trackStreamPosition(e,r,s,n){if(!(!r||!s))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(r),this.streamsPositions[r]={epoch:s,offset:n},{stream:r,epoch:s,offset:n}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,r){return this.presenceInfo[e]=r,this.cable.send({command:"join",identifier:e,presence:r}),Promise.resolve()}async leave(e,r){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:r}),Promise.resolve()}presence(e,r){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((s,n)=>{this.pendingPresence[e]={resolve:s,reject:n},this.cable.send({command:"presence",identifier:e,data:r})})}}class qs extends te{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class qe extends It{constructor(e,r){super(r),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ie(qe,"identifier","__ghost__");const Ds="$pubsub";class De extends It{async perform(e,r){if(e.startsWith("$"))return super.perform(e,r);throw Error("not implemented")}}ie(De,"identifier",Ds);const M=Symbol("state");let Bs=class{constructor({transport:t,protocol:e,encoder:r,logger:s,lazy:n,hubOptions:i,performFailures:o,transportConfigurator:c}){this.emitter=ye(),this.transport=t,this.encoder=r,this.logger=s||new re,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new Ls(i||{}),this[M]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=c,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[M]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[M]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(r){this.handleClose(r)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[M]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new P("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[M]="connected",this.hub.subscriptions.all().forEach(s=>{t&&s.remoteId&&t.includes(s.remoteId)?s.notify("restored"):(s.notify("disconnected",new P("recovery_failed")),this._resubscribe(s))});let e=!this.initialConnect,r=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:r})}notify(t,e,r){e&&typeof e!="string"&&(r=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:r}):this.emit("info",{type:t,data:r})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new P(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[M]="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 P?t:new P(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[M]="closed";let r=e||new P("cable_closed");this.hub.subscriptions.all().forEach(s=>s.notify("disconnected",r)),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 r=this.protocol.receive(e);if(r){this.logger.debug("processed incoming message",r);let{type:s,identifier:n,message:i,meta:o}=r;s?this.hub.notify(n,s,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 De({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new De({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let r,s;return typeof t=="string"&&(s=t,t=qe),r=s?new t(s,e):new t(e),this.subscribe(r)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let r=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:s=>this._subscribe(s,t.channelId,t.params),unsubscribe:s=>this._unsubscribe(s)});return r.add(t),r.intent==="subscribed"&&r.state==="connected"&&t.connected(),r.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,r){let s=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s});return}this.logger.debug("acquiring subscribe lock",{identifier:s});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:s}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:s}),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:s}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:s}),t.notify("connected"),n.release();return}let i={identifier:e,params:r};this.logger.debug("subscribing",i);try{let o=await this.protocol.subscribe(e,r);this.hub.subscribe(s,o),this.logger.debug("subscribed",{...i,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof $e&&this.logger.warn("rejected",i),o instanceof P){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(s)}n.release()}unsubscribe(t){let e=t.identifier,r=this.hub.subscriptions.get(e);if(!r)throw Error(`Subscription not found: ${e}`);r.remove(t),t.closed(),r.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let r=await t.acquire("unsubscribed");if(r.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),r.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}),r.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),r.release();return}let s=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:s}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),r.release();return}try{await this.protocol.unsubscribe(s),this.logger.debug("unsubscribed remotely",{id:e})}catch(n){n&&(n instanceof P?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",r.release()}async perform(t,e,r){if(this.performFailures==="throw")return this._perform(t,e,r);try{return await this._perform(t,e,r)}catch(s){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:s});return}}async _perform(t,e,r){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new qs;let s=this.hub.subscriptions.get(t);if(!s)throw Error(`Subscription not found: ${t}`);if(await s.pending("subscribed"),s.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=s.remoteId,i={id:n,action:e,payload:r};this.logger.debug("perform",i);try{let o=await this.protocol.perform(n,e,r);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 r=this.emitter.on(t,(...s)=>{r(),e(...s)});return r}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let r=[()=>delete this._pendingConnect];r.push(this.on("connect",()=>{r.forEach(s=>s()),t()})),r.push(this.on("close",s=>{r.forEach(n=>n()),e(s)})),r.push(this.on("disconnect",s=>{r.forEach(n=>n()),e(s)}))}),this._pendingConnect)}};const Ms={maxMissingPings:2,maxReconnectAttempts:1/0},V=()=>Date.now(),$t=(t,e)=>{e=e||{};let{backoffRate:r,jitterRatio:s,maxInterval:n}=e;return r=r||2,s===void 0&&(s=.5),i=>{let o=t*r**i,c=o*r,u=o+(c-o)*Math.random(),l=2*(Math.random()-.5)*s;return u=u*(1+l),n&&n<u&&(u=n),u}};let qt=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},Ms,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 re,this.state="pending_connect",this.attempts=0,this.disconnectedAt=V()}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=V(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=V(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=V(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=V()})),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=V()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new ks))}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 zs{constructor(e,r={}){this.transports=e,this.transport=null,this.emitter=ye(),this.unbind=[],this.logger=r.logger||new re}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let r=this.transports[e];try{this.transport=r,this.resetListeners(),this.logger.debug(`Trying to connect via ${r.displayName()}`),await r.open(),this.logger.debug(`Connected via ${r.displayName()}`);return}catch(s){this.logger.debug(`Failed to connect via ${r.displayName()}: ${s.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,r){this.transports.forEach(s=>{s.setParam(e,r)})}setToken(e,r){this.transports.forEach(s=>{s.setToken(e,r)})}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 Js{constructor(e,r={}){this.url=e;let s=r.websocketImplementation;if(s)this.Impl=s;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=ye();let{format:n,subprotocol:i,authStrategy:o}=r;this.format=n||"text",this.connectionOptions=r.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((r,s)=>{let n=[];n.push(this.once("open",()=>{n.forEach(i=>i()),r()})),n.push(this.once("close",()=>{n.forEach(i=>i()),s(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,r){let s=new URL(this.url);s.searchParams.set(e,r);let n=`${s.protocol}//${s.host}${s.pathname}?${s.searchParams}`;this.setURL(n)}setToken(e,r="jid"){if(this.authStrategy==="param")this.setParam(r,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let s=`x-${r}`.toLowerCase();s=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===s)||s,this.connectionOptions.headers[s]=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,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 r=e.data;this.format==="binary"&&(r=new Uint8Array(r)),this.emitter.emit("data",r)},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 Dt={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Ws(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({},Dt,e);let{protocol:r,websocketImplementation:s,websocketFormat:n,websocketOptions:i,websocketAuthStrategy:o,fallbacks:c,logLevel:u,logger:l,transport:h,encoder:p,lazy:g,monitor:d,pingInterval:y,reconnectStrategy:f,maxMissingPings:S,maxReconnectAttempts:w,subprotocol:_,tokenRefresher:T,historyTimestamp:L,protocolOptions:O,concurrentSubscribes:N,performFailures:z,transportConfigurator:F,auth:U}=e;if(l=l||new re(u),typeof r=="string"){_=_||r;let K=r.substring(0,r.lastIndexOf("-")),C=r.substring(r.lastIndexOf("-")+1);if(O=O||{},K==="actioncable-v1")r=new Ut({logger:l,...O});else if(K==="actioncable-v1-ext")r=new $s({logger:l,historyTimestamp:L,...O});else throw Error(`Protocol is not supported yet: ${r}`);if(C==="json")p=p||new Us,n=n||"text";else if(C==="msgpack"){if(n="binary",!p)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(C==="protobuf"){if(n=n||"binary",!p)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: ${r}`)}if(!r)throw Error("Protocol must be specified");h=h||new Js(t,{websocketImplementation:s,websocketOptions:i,subprotocol:_,authStrategy:o,format:n}),c&&(h=new zs([h,...c],{logger:l})),U&&U.token&&h.setToken(U.token,U.param||"jid"),f=f||$t(y),d!==!1&&(d=d||new qt({pingInterval:y,reconnectStrategy:f,maxMissingPings:S,maxReconnectAttempts:w,logger:l}));let He={concurrentSubscribes:N},j=new Bs({protocol:r,transport:h,encoder:p,logger:l,lazy:g,hubOptions:He,performFailures:z,transportConfigurator:F});return d&&(d.watch(j),j.monitor=d),T&&Hs(j,async()=>{try{await T(h)}catch(K){return l.error("Failed to refresh authentication token: "+K),!1}return j.connect().catch(()=>{}),!0}),j}function Hs(t,e){let r=!1;t.on("connect",()=>r=!1),t.on("close",async s=>{if(s){if(r){t.logger.warn("Token auto-refresh is disabled",s);return}s.reason==="token_expired"&&(r=!0,await e())}})}class Vs{constructor(e){this.channel=e}notify(e,...r){typeof this[e]=="function"&&this[e](...r)}perform(e,r={}){this.channel.perform(e,r)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class Ks extends qe{constructor(e,r,s){super(e,r),this.subscription=new Vs(this),Object.assign(this.subscription,s),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 $e?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Xs{constructor(e){this.cable=e}create(e,r){let s,n;typeof e=="object"?(s=e.channel,delete e.channel,n=e):(s=e,n={});let i=new Ks(s,n,r);return i.subscription.notify("initialized"),this.cable.subscribe(i),i.subscription}findAll(e){return this.cable.hub.channels.filter(r=>r.identifier===e).map(r=>r.subscription)}}class Gs{constructor(e){this.cable=e,this.subscriptions=new Xs(e)}}class Qs extends Lt{writeLogEntry(e,r,s){s?console[e](r,s):console[e](r)}}class Ys extends qt{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")},r=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},s=()=>this.disconnect(new P("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",r,!1),window.addEventListener("resume",r,!1),window.addEventListener("freeze",s,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",r,!1),window.removeEventListener("online",r,!1),window.removeEventListener("resume",r,!1),window.removeEventListener("freeze",s,!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 Zs=["cable","action-cable"],en="/cable",_e=(t,e)=>{for(let r of Zs){let s=t.head.querySelector(`meta[name='${r}-${e}']`);if(s)return s.getAttribute("content")}},Bt=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=_e(document,"url");if(t)return Bt(t)}return Bt(en)},rn=()=>{if(typeof document<"u"&&document.head){let t=_e(document,"history-timestamp");if(t)return t|0}},sn=()=>{if(typeof document<"u"&&document.head)return _e(document,"token")},nn=()=>{if(typeof document<"u"&&document.head)return _e(document,"token-param")};function on(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||tn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=rn());let r=sn();if(r){let l=nn();e.auth=Object.assign({token:r,param:l},e.auth||{})}e=Object.assign({},Dt,e);let{logLevel:s,logger:n,pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:u}=e;return n=e.logger=e.logger||new Qs(s),o=e.reconnectStrategy=e.reconnectStrategy||$t(i),e.monitor!==!1&&(e.monitor=e.monitor||new Ys({pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:u,logger:n})),Ws(t,e)}function cn(t,e){let r=on(t,e);return new Gs(r)}class an{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,r,s={},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=cn(o)}return this._cable.subscriptions.create({channel:e,...n},s)})}recordPing(){}}Ee("u",an);function we(t){return ln.test(t)}const ln=/^-?[0-9]+$/;function Mt(t){return un.test(t)}const un=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function zt(t,e){const r=Number.parseFloat(t),s=String(r);if(t===s)return!0;const n=Jt(t),i=Jt(s);return!!(n===i||(e==null?void 0:e.approx)===!0&&!we(t)&&i.length>=14&&n.startsWith(i.substring(0,14)))}let se=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function hn(t){if(zt(t,{approx:!1}))return;if(we(t))return se.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?se.underflow:se.truncate_float:se.overflow}function Jt(t){const{start:e,end:r}=dn(t),s=t.substring(e,r),n=s.indexOf(".");return n===-1?s:s.substring(0,n)+s.substring(n+1)}function dn(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let r=t.lastIndexOf("e");for(r===-1&&(r=t.lastIndexOf("E")),r===-1&&(r=t.length);(t[r-1]==="0"||t[r-1]===".")&&r>e;)r--;return{start:e,end:r}}class fn{constructor(e){if(ie(this,"isLosslessNumber",!0),!Mt(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=hn(this.value);if(e===void 0||e===se.truncate_float)return Number.parseFloat(this.value);if(we(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 pn(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function gn(t){return new fn(t)}function mn(t,e){return Be({"":t},"",t,e)}function Be(t,e,r,s){return Array.isArray(r)?s.call(t,e,yn(r,s)):r&&typeof r=="object"&&!pn(r)?s.call(t,e,bn(r,s)):s.call(t,e,r)}function bn(t,e){for(const r of Object.keys(t)){const s=Be(t,r,t[r],e);s!==void 0?t[r]=s:delete t[r]}return t}function yn(t,e){for(let r=0;r<t.length;r++)t[r]=Be(t,String(r),t[r],e);return t}function _n(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gn,s=0;const n=c();return y(n),S(),e?mn(n,e):n;function i(){if(t.charCodeAt(s)===On){s++,l();const b={};let E=!0;for(;s<t.length&&t.charCodeAt(s)!==Ht;){E?E=!1:(g(),l());const J=s,ne=h();if(ne===void 0){T();return}l(),d();const Ve=c();if(Ve===void 0){U();return}Object.prototype.hasOwnProperty.call(b,ne)&&!Me(Ve,b[ne])&&L(ne,J+1),b[ne]=Ve}return t.charCodeAt(s)!==Ht&&O(),s++,b}}function o(){if(t.charCodeAt(s)===Rn){s++,l();const b=[];let E=!0;for(;s<t.length&&t.charCodeAt(s)!==Vt;){E?E=!1:g();const J=c();f(J),b.push(J)}return t.charCodeAt(s)!==Vt&&N(),s++,b}}function c(){l();const b=h()??p()??i()??o()??u("true",!0)??u("false",!1)??u("null",null);return l(),b}function u(b,E){if(t.slice(s,s+b.length)===b)return s+=b.length,E}function l(){for(;wn(t.charCodeAt(s));)s++}function h(){if(t.charCodeAt(s)===ze){s++;let b="";for(;s<t.length&&t.charCodeAt(s)!==ze;){if(t.charCodeAt(s)===xn){const E=t[s+1],J=En[E];J!==void 0?(b+=J,s++):E==="u"?ve(t.charCodeAt(s+2))&&ve(t.charCodeAt(s+3))&&ve(t.charCodeAt(s+4))&&ve(t.charCodeAt(s+5))?(b+=String.fromCharCode(Number.parseInt(t.slice(s+2,s+6),16)),s+=5):He(s):F(s)}else Sn(t.charCodeAt(s))?b+=t[s]:z(t[s]);s++}return _(),s++,b}}function p(){const b=s;if(t.charCodeAt(s)===Kt&&(s++,w(b)),t.charCodeAt(s)===Je)s++;else if(vn(t.charCodeAt(s)))for(s++;Se(t.charCodeAt(s));)s++;if(t.charCodeAt(s)===Nn)for(s++,w(b);Se(t.charCodeAt(s));)s++;if(t.charCodeAt(s)===qn||t.charCodeAt(s)===$n)for(s++,(t.charCodeAt(s)===Kt||t.charCodeAt(s)===Pn)&&s++,w(b);Se(t.charCodeAt(s));)s++;if(s>b)return r(t.slice(b,s))}function g(){if(t.charCodeAt(s)!==In)throw new SyntaxError(`Comma ',' expected after value ${C()}`);s++}function d(){if(t.charCodeAt(s)!==Ln)throw new SyntaxError(`Colon ':' expected after property name ${C()}`);s++}function y(b){if(b===void 0)throw new SyntaxError(`JSON value expected ${C()}`)}function f(b){if(b===void 0)throw new SyntaxError(`Array item expected ${C()}`)}function S(){if(s<t.length)throw new SyntaxError(`Expected end of input ${C()}`)}function w(b){if(!Se(t.charCodeAt(s))){const E=t.slice(b,s);throw new SyntaxError(`Invalid number '${E}', expecting a digit ${C()}`)}}function _(){if(t.charCodeAt(s)!==ze)throw new SyntaxError(`End of string '"' expected ${C()}`)}function T(){throw new SyntaxError(`Quoted object key expected ${C()}`)}function L(b,E){throw new SyntaxError(`Duplicate key '${b}' encountered at position ${E}`)}function O(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${C()}`)}function N(){throw new SyntaxError(`Array item or end of array ']' expected ${C()}`)}function z(b){throw new SyntaxError(`Invalid character '${b}' ${j()}`)}function F(b){const E=t.slice(b,b+2);throw new SyntaxError(`Invalid escape character '${E}' ${j()}`)}function U(){throw new SyntaxError(`Object value expected after ':' ${j()}`)}function He(b){const E=t.slice(b,b+6);throw new SyntaxError(`Invalid unicode character '${E}' ${j()}`)}function j(){return`at position ${s}`}function K(){return s<t.length?`but got '${t[s]}'`:"but reached end of input"}function C(){return`${K()} ${j()}`}}function wn(t){return t===An||t===Cn||t===Tn||t===kn}function ve(t){return t>=Je&&t<=We||t>=Un&&t<=Dn||t>=Fn&&t<=Bn}function Se(t){return t>=Je&&t<=We}function vn(t){return t>=jn&&t<=We}function Sn(t){return t>=32&&t<=1114111}function Me(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>Me(r,e[s])):Wt(t)&&Wt(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(r=>Me(t[r],e[r])):!1}function Wt(t){return typeof t=="object"&&t!==null}const En={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
7
- `,r:"\r",t:" "},xn=92,On=123,Ht=125,Rn=91,Vt=93,An=32,Cn=10,Tn=9,kn=13,ze=34,Pn=43,Kt=45,Je=48,jn=49,We=57,In=44,Nn=46,Ln=58,Un=65,Fn=97,$n=69,qn=101,Dn=70,Bn=102;function Xt(t,e,r,s){return n(t);function n(u,l){if(Array.isArray(s)){const h=s.find(p=>p.test(u));if(h){const p=h.stringify(u);if(typeof p!="string"||!Mt(p))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${p})`);return p}}if(typeof u=="boolean"||typeof u=="number"||typeof u=="string"||u===null||u instanceof Date||u instanceof Boolean||u instanceof Number||u instanceof String)return JSON.stringify(u);if(u!=null&&u.isLosslessNumber||typeof u=="bigint")return u.toString();if(Array.isArray(u))return i(u);if(u&&typeof u=="object")return o(u)}function i(u,l){if(u.length===0)return"[]";let h="[";for(let p=0;p<u.length;p++){const g=u[p];typeof g<"u"&&typeof g!="function"?h+=n(g):h+="null",p<u.length-1&&(h+=",")}return h+="]",h}function o(u,l){if(typeof u.toJSON=="function")return Xt(u.toJSON(),e,r,void 0);const h=Array.isArray(e)?e.map(String):Object.keys(u);if(h.length===0)return"{}";let p=!0,g="{";for(const d of h){const y=u[d];if(c(d,y)){p?p=!1:g+=",";const f=JSON.stringify(d);g+=`${f}:`,g+=n(y)}}return g+="}",g}function c(u,l){return typeof l<"u"&&typeof l!="function"&&typeof l!="symbol"}}function Mn(t){return we(t)&&!zt(t)?BigInt(t):parseFloat(t)}class zn{constructor(){ie(this,"id",1)}async exec(e,r,s={},n={},i=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return s.scope=window.openc3Scope,n.manual=!0,(await Ue.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:r,id:this.id,keyword_params:s},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:i,transformRequest:[(o,c)=>Xt(o)],transformResponse:[o=>_n(o,void 0,Mn)]})).data.result}catch(o){let c=new Error;throw o.response?(c.name=o.response.data.error.data.class,c.message=o.response.data.error.data.message,c.object=o.response.data.error):o.request?(c.name="Request error",c.message="Request error, no response received"):c=o,c}}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,r){return this.exec("map_target_to_interface",[e,r])}connect_interface(e,...r){return r.length>0?this.exec("connect_interface",[e,...r]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,r,...s){return this.exec("interface_cmd",[e,r,...s])}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,r,s){return this.exec("get_item",[e,r,s])}get_param(e,r,s){return this.exec("get_param",[e,r,s])}get_parameter(e,r,s){return this.exec("get_param",[e,r,s])}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,r){return this.exec("get_tlm",[e,r])}get_telemetry(e,r){return this.exec("get_tlm",[e,r])}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,r=!1){return this.exec("get_all_tlm_names",[e],{hidden:r})}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,r,s,n=30){const i=await this.exec("get_tlm_packet",[e,r],{type:s,stale_time:n});if(i!=null){let o=i.length,c=null;for(let u=0;u<o;u++)c=this.decode_openc3_type(i[u][1]),c!==null&&(i[u][1]=c)}return i}get_packet_derived_items(e,r){return this.exec("get_packet_derived_items",[e,r])}get_tlm_buffer(e,r){return this.exec("get_tlm_buffer",[e,r])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,r=30,s=null,n=null,i=null){let o={stale_time:r};s!==null&&(o.cache_timeout=s),n!==null&&(o.start_time=n.toISOString()),i!==null&&(o.end_time=i.toISOString());const c=await this.exec("get_tlm_values",[e],o,{},1e4);if(c&&c.length>0){let u=c[0].length,l=null;for(let h=0;h<u;h++)l=this.decode_openc3_type(c[0][h]),l!==null&&(c[0][h]=l)}return c}get_limits(e,r,s){return this.exec("get_limits",[e,r,s])}async tlm(e,r,s,n="CONVERTED"){let i=null;if(r===void 0)i=await this.exec("tlm",[e]);else if(s===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(r))i=await this.exec("tlm",[e],{type:r});else{let c=new Error;throw c.name="TypeError",c.message=`Invalid data type ${r}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,c}else i=await this.exec("tlm",[e,r,s],{type:n});let o=this.decode_openc3_type(i);return o!==null&&(i=o),i}async inject_tlm(e,r,s=null,n="CONVERTED"){await this.exec("inject_tlm",[e,r,s],{type:n})}set_tlm(e,r,s,n){return this.exec("set_tlm",[e,r,s],{type:n})}override_tlm(e,r,s,n){return this.exec("override_tlm",[e,r,s],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,r,s,n){return this.exec("normalize_tlm",[e,r,s],{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,r=!1){return this.exec("get_all_cmd_names",[e],{hidden:r})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,r){return this.exec("get_cmd",[e,r])}get_command(e,r){return this.exec("get_cmd",[e,r])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,r,s,n="CONVERTED"){return this.exec("get_cmd_value",[e,r,s,n])}get_cmd_buffer(e,r){return this.exec("get_cmd_buffer",[e,r])}_cmd(e,r,s,n,i){let o=null;for(let c in n)Object.prototype.hasOwnProperty.call(n,c)&&(o=this.encode_openc3_type(n[c]),o!==null&&(n[c]=o));return this.exec(e,[r,s,n],{},i)}get_cmd_hazardous(e,r,s,n={}){return r===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,r,s,n)}cmd(e,r,s,n={}){return r===void 0?this.exec("cmd",e,{},n):this._cmd("cmd",e,r,s,n)}cmd_no_range_check(e,r,s,n={}){return r===void 0?this.exec("cmd_no_range_check",e,{},n):this._cmd("cmd_no_range_check",e,r,s,n)}cmd_raw(e,r,s,n={}){return r===void 0?this.exec("cmd_raw",e,{},n):this._cmd("cmd_raw",e,r,s,n)}cmd_raw_no_range_check(e,r,s,n={}){return r===void 0?this.exec("cmd_raw_no_range_check",e,{},n):this._cmd("cmd_raw_no_range_check",e,r,s,n)}cmd_no_hazardous_check(e,r,s,n={}){return r===void 0?this.exec("cmd_no_hazardous_check",e,{},n):this._cmd("cmd_no_hazardous_check",e,r,s,n)}cmd_no_checks(e,r,s,n={}){return r===void 0?this.exec("cmd_no_checks",e,{},n):this._cmd("cmd_no_checks",e,r,s,n)}cmd_raw_no_hazardous_check(e,r,s,n={}){return r===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},n):this._cmd("cmd_raw_no_hazardous_check",e,r,s,n)}cmd_raw_no_checks(e,r,s,n={}){return r===void 0?this.exec("cmd_raw_no_checks",e,{},n):this._cmd("cmd_raw_no_checks",e,r,s,n)}build_cmd(e,r,s){return r===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,r,s)}build_command(e,r,s){return r===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,r,s)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,r){return this.exec("send_raw",[e,r])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,r){return this.exec("load_config",[e,r])}save_config(e,r,s){return this.exec("save_config",[e,r,s])}delete_config(e,r){return this.exec("delete_config",[e,r])}enable_limits(e,r,s){return this.exec("enable_limits",[e,r,s])}disable_limits(e,r,s){return this.exec("disable_limits",[e,r,s])}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,r){return this.exec("get_setting",[e],r)}get_settings(e,r){return this.exec("get_settings",e,r)}set_setting(e,r){return this.exec("set_setting",[e,r])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}save_setting(e,r){return this.exec("set_setting",[e,r])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),n=new Uint8Array(s);return Array.from(n).map(i=>i.toString(16).padStart(2,"0")).join("")}}}Ee("d",zn)}}});