openc3-cosmos-tool-cmdtlmserver 6.8.1 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/tools/cmdtlmserver/ArrayWidget-DLfNWDzN-1e8a3face2ed377ee14b.js +2 -0
- data/tools/cmdtlmserver/ArrayplotWidget-CoRsUxHG-9354353a435dca29d91b.js +1 -0
- data/tools/cmdtlmserver/BarColumn-DHP-zQ4R-13ea24b96ea1a8d35a6a.js +1 -0
- data/tools/cmdtlmserver/BlockWidget-BmHSFvOq-9bcd30fb55af2e9adfcc.js +2 -0
- data/tools/cmdtlmserver/ButtonWidget-C3ZWRjZZ-a09343e371e16d86fb23.js +2 -0
- data/tools/cmdtlmserver/CanvasWidget-CL-XzPF4-fa3331797f3605b54876.js +1 -0
- data/tools/cmdtlmserver/CanvasdotWidget-D8Y9DgVE-202754fdc6e1f8bc69b8.js +1 -0
- data/tools/cmdtlmserver/CanvasimageWidget-DHSGK_tD-706d31ac92632aa26d40.js +1 -0
- data/tools/cmdtlmserver/CanvasimagevalueWidget-Btt_fQfC-6211eb7aa7d153f644a5.js +1 -0
- data/tools/cmdtlmserver/CanvaslabelWidget-BF_8RTjv-ec3af661f0fe151ab181.js +1 -0
- data/tools/cmdtlmserver/CanvaslabelvalueWidget-scbwaujI-6f6e59336806beadc6d3.js +1 -0
- data/tools/cmdtlmserver/CanvaslineWidget-gRvm_-TT-6d1e9b263ef79c1b1647.js +1 -0
- data/tools/cmdtlmserver/CanvaslinevalueWidget-CljziRek-4250356d341ec24d29f4.js +1 -0
- data/tools/cmdtlmserver/CheckbuttonWidget-BOabI_jE-e4387e7d27cd938ef89b.js +1 -0
- data/tools/cmdtlmserver/CmdPacketsTab-7e20541da3036a84b375.js +1 -0
- data/tools/cmdtlmserver/CmdTlmServer-7b54c774fee5033c13bd.js +2 -0
- data/tools/cmdtlmserver/ComboboxWidget-BLXNYFiY-d5fd5406c480881fb5d4.js +1 -0
- data/tools/cmdtlmserver/DataFlowsTab-368d1fdb4209d66844af.js +1 -0
- data/tools/cmdtlmserver/DateWidget-BTqLCtLS-202c9085c8a667b42627.js +1 -0
- data/tools/cmdtlmserver/DetailsDialog-BNCS3QAe-2191292a9b1ab8d8ae75.js +1 -0
- data/tools/cmdtlmserver/DynamicWidget-CfMtj7H8-3e0eec47273fa4c63aee.js +1 -0
- data/tools/cmdtlmserver/FormatvalueWidget-CLYx8qbg-2913871219c14842cecb.js +1 -0
- data/tools/cmdtlmserver/Graph-BliBYJxD-bb80bc8984750d2f31de.js +1 -0
- data/tools/cmdtlmserver/GraphWidget-Cb6Ozf54-52583b1f0ff33268742b.js +1 -0
- data/tools/cmdtlmserver/HorizontalWidget-AY2M01qP-c726ad4d7b9989195780.js +1 -0
- data/tools/cmdtlmserver/HorizontalboxWidget-2MEKvq_C-caebeb4bc79733504840.js +1 -0
- data/tools/cmdtlmserver/HorizontallineWidget-DgpOPA7q-3e3c6a88bc67fe5f390c.js +1 -0
- data/tools/cmdtlmserver/IframeWidget-UKKUl7k5-58809376594a655a5f2a.js +1 -0
- data/tools/cmdtlmserver/ImageLoader-C-CIL4YD-bc35b32770c8a5c44e5e.js +1 -0
- data/tools/cmdtlmserver/ImageviewerWidget-DhuQH5Io-78d2c2dd21a053a89c51.js +1 -0
- data/tools/cmdtlmserver/InterfaceFlowChart-5d2b3bb2659991d3b6a7.js +27 -0
- data/tools/cmdtlmserver/InterfacesTab-3009a17e96e92ac1e70a.js +1 -0
- data/tools/cmdtlmserver/LabelWidget-SO9zqcNN-a13de181566f05837b14.js +1 -0
- data/tools/cmdtlmserver/LabelledWidget-DWoM5AJ5-ec761858f941c15ff604.js +1 -0
- data/tools/cmdtlmserver/LabelprogressbarWidget-D3vnkvQZ-af0accd1118f3923a9a3.js +1 -0
- data/tools/cmdtlmserver/LabelsparklineWidget-DO0T-Jot-ecf847a6e96a08b254ab.js +1 -0
- data/tools/cmdtlmserver/LabelvalueWidget-B6BbNFnk-3d45d1e6db6b2f8d29a5.js +1 -0
- data/tools/cmdtlmserver/LabelvaluedescWidget-CxfL-H9C-3a42edd68921e90d31ca.js +1 -0
- data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-BT5k9mHv-52975b7494653d8c515f.js +1 -0
- data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-DUbmxh4p-f295e97e30657fccc248.js +1 -0
- data/tools/cmdtlmserver/LabelvaluerangebarWidget-DexAc2UB-f151f5b53d9d4b184b06.js +1 -0
- data/tools/cmdtlmserver/Layout-Dd6dRf3R-ef7bd13b7ea3d133ccb0.js +1 -0
- data/tools/cmdtlmserver/LedWidget-D1RwHb_V-260ff4715a4a88a41508.js +1 -0
- data/tools/cmdtlmserver/LimitsbarWidget-ClOmoV50-48e5673dec9cb6e22731.js +1 -0
- data/tools/cmdtlmserver/LimitscolorWidget-CBUoEYKp-41ffd9d133666ed0f970.js +1 -0
- data/tools/cmdtlmserver/LimitscolumnWidget-hsHkmY-_-a3f6218974e5498090eb.js +1 -0
- data/tools/cmdtlmserver/LinegraphWidget-CXrKtxOo-be6c9cdfe9742e8d3bbc.js +1 -0
- data/tools/cmdtlmserver/MatrixbycolumnsWidget-CsogVU9c-8bc60a5aed8d3cabf27c.js +1 -0
- data/tools/cmdtlmserver/ProgressbarWidget-CO6CEkxP-4f04f42e3b29e4f6badf.js +1 -0
- data/tools/cmdtlmserver/RadiobuttonWidget-DrxUclws-e53a8ceae55c8d39b1bc.js +1 -0
- data/tools/cmdtlmserver/RadiogroupWidget-DN9C38cg-d3e2cee52f161e968cda.js +1 -0
- data/tools/cmdtlmserver/RangebarWidget-5uQTfLMP-3dc94e1929eab734826a.js +1 -0
- data/tools/cmdtlmserver/RawBuffer-5d94750d4746b711f55b.js +6 -0
- data/tools/cmdtlmserver/RawDialog-772a1282457ac36fd7a8.js +5 -0
- data/tools/cmdtlmserver/RollupWidget-B0DCULnu-75370b4e7a1f88bdc783.js +1 -0
- data/tools/cmdtlmserver/RoutersTab-2e3fa3d19fb8969dfab5.js +1 -0
- data/tools/cmdtlmserver/ScrollwindowWidget-BOkZQgtf-5862d90a0a854f7253c4.js +1 -0
- data/tools/cmdtlmserver/SignalWidget-Cis0Xkea-6a51ce3da68ffd3d9ac5.js +1 -0
- data/tools/cmdtlmserver/SpacerWidget-CLcqC2Qk-81d85af00986f3f5b056.js +1 -0
- data/tools/cmdtlmserver/SparklineWidget-CTp83eZ--bfbe9dc264b948bfeccf.js +1 -0
- data/tools/cmdtlmserver/StatusTab-37f142b5a919a517b454.js +1 -0
- data/tools/cmdtlmserver/TabbookWidget-uucd-zsX-f9571b1707f3d2313c74.js +1 -0
- data/tools/cmdtlmserver/TargetsTab-31817182dd194fae103f.js +1 -0
- data/tools/cmdtlmserver/TextboxWidget-C2n38ti5-70eef7e9cc17f76c4b45.js +1 -0
- data/tools/cmdtlmserver/TextfieldWidget--HTv9ddk-4f61e63b99bb27d3d0f9.js +1 -0
- data/tools/cmdtlmserver/TimeWidget-CPNVZaUM-84e9c1d910942f7918cb.js +1 -0
- data/tools/cmdtlmserver/TitleWidget-Cp0cb6V8-26da1f1345ebd0e2d8d2.js +1 -0
- data/tools/cmdtlmserver/TlmPacketsTab-8ab3463162d1614ac633.js +1 -0
- data/tools/cmdtlmserver/Updater-837ca86e536f4a3bdfa3.js +1 -0
- data/tools/cmdtlmserver/VWidget-DQGJRgAk-db0f8060669e1acf20ea.js +1 -0
- data/tools/cmdtlmserver/ValueWidget-Bk1RFjks-404325b51d8960d194ea.js +1 -0
- data/tools/cmdtlmserver/ValuelimitsbarWidget-C0HIBYh2-b127b268f152554e33fc.js +1 -0
- data/tools/cmdtlmserver/ValuelimitscolumnWidget-BTT90uyX-1d351782a10b310813e7.js +1 -0
- data/tools/cmdtlmserver/ValuerangebarWidget-CcQw_XK9-4bfb89b00ab2e5f9864a.js +1 -0
- data/tools/cmdtlmserver/VerticalWidget-CNtFQv3R-7c9384e32e2a84bdb6a3.js +1 -0
- data/tools/cmdtlmserver/VerticalboxWidget-Yxmz1SnU-f6d8fdccf06693ea3492.js +1 -0
- data/tools/cmdtlmserver/Widget-LsyjS7ZS-7441069f38e76756cf77.js +1 -0
- data/tools/cmdtlmserver/main-f371259352e08317c745.js +1505 -0
- data/tools/cmdtlmserver/main.js +1 -1
- data/tools/cmdtlmserver/services-eb1403f6c88517815ca2.js +7 -0
- metadata +81 -78
- data/tools/cmdtlmserver/ArrayWidget-FGjLmPfG-683db8ebbd412ff5cf60.js +0 -2
- data/tools/cmdtlmserver/ArrayplotWidget-Cfo18TYm-c2c8c904050bb47be42d.js +0 -1
- data/tools/cmdtlmserver/BarColumn-BuJ6MTYG-cd72ee4fac54e0162c5b.js +0 -1
- data/tools/cmdtlmserver/BlockWidget-B_JwY8-N-4d0fd7f8eaf32c3149fa.js +0 -2
- data/tools/cmdtlmserver/ButtonWidget-Cd4M3aBD-c6e6ee5a4de20cee38c4.js +0 -2
- data/tools/cmdtlmserver/CanvasWidget-CpKdOgTG-e21cfaf765f87dc06820.js +0 -1
- data/tools/cmdtlmserver/CanvasdotWidget-zYbI5LAw-75b3ab3135056a71bd66.js +0 -1
- data/tools/cmdtlmserver/CanvasimageWidget--ORQEPj6-c58343b2fe7598056f45.js +0 -1
- data/tools/cmdtlmserver/CanvasimagevalueWidget-CtAtYHRm-70ebc4e8daa927c22814.js +0 -1
- data/tools/cmdtlmserver/CanvaslabelWidget-DWoROb6o-476ec50948cf48d49fbd.js +0 -1
- data/tools/cmdtlmserver/CanvaslabelvalueWidget-A4UbtwEc-1c361cc4b4b5146a5d33.js +0 -1
- data/tools/cmdtlmserver/CanvaslineWidget-BBGi0nrb-d4088e55a3153f2ccb95.js +0 -1
- data/tools/cmdtlmserver/CanvaslinevalueWidget-C_9OkL7f-ffe44fffbe9c6f58dd9e.js +0 -1
- data/tools/cmdtlmserver/CheckbuttonWidget-CTJg8Ypg-e7b7bf6b3dd279023328.js +0 -1
- data/tools/cmdtlmserver/CmdPacketsTab-f0bc4223a524614b062f.js +0 -1
- data/tools/cmdtlmserver/CmdTlmServer-bc76235d10c09682c6e2.js +0 -2
- data/tools/cmdtlmserver/ComboboxWidget-DWiMZZk8-656b04f7d9af94bd5d42.js +0 -1
- data/tools/cmdtlmserver/DateWidget-C7GSh68_-13f0f32ea6e8efc4871a.js +0 -1
- data/tools/cmdtlmserver/DetailsDialog-B2l0BNc2-9ae1d4713aeae76dbd5d.js +0 -1
- data/tools/cmdtlmserver/DynamicWidget-CfMtj7H8-925a3fc3c572312a55a3.js +0 -1
- data/tools/cmdtlmserver/FormatvalueWidget-CZJdsUAq-bb32367559b73c0909bc.js +0 -1
- data/tools/cmdtlmserver/Graph-DZBpdSgR-f56dde00f81280043da9.js +0 -1
- data/tools/cmdtlmserver/GraphWidget-CHm4bhMI-44dd778434539663613d.js +0 -1
- data/tools/cmdtlmserver/HorizontalWidget-B2skpV1m-b23f5fd3c367fd63ccd6.js +0 -1
- data/tools/cmdtlmserver/HorizontalboxWidget-BI0WZP5M-ee4fbb561897d0ecd67f.js +0 -1
- data/tools/cmdtlmserver/HorizontallineWidget-AmxVeXcU-288549f981a254098664.js +0 -1
- data/tools/cmdtlmserver/IframeWidget-DcqRMhyW-5e1bb93e1aa72c466dd2.js +0 -1
- data/tools/cmdtlmserver/ImageLoader-ly4zoGpO-b6ef72444fb0db18f0a6.js +0 -1
- data/tools/cmdtlmserver/ImageviewerWidget-cmDHcmW4-f29c44e7be2549619a02.js +0 -1
- data/tools/cmdtlmserver/InterfacesTab-ef2e279c2d974542fbb7.js +0 -1
- data/tools/cmdtlmserver/LabelWidget-Bemw8Erq-77bfb932644b19401509.js +0 -1
- data/tools/cmdtlmserver/LabelledWidget-Cb7EvtUG-21700e23054272de0cdf.js +0 -1
- data/tools/cmdtlmserver/LabelprogressbarWidget-qYgrGqLY-afe2e284394185569250.js +0 -1
- data/tools/cmdtlmserver/LabelsparklineWidget-CMklq9-f-89ac388088ab17b0d9b2.js +0 -1
- data/tools/cmdtlmserver/LabelvalueWidget-NjCMgiYL-c36a0b089904315582dd.js +0 -1
- data/tools/cmdtlmserver/LabelvaluedescWidget-Dflulqm7-b5d359d3b572346f63af.js +0 -1
- data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-M34NDk2S-e8550809276767a62c80.js +0 -1
- data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-Cchaw_-k-8b4ee4b4717aaff157c9.js +0 -1
- data/tools/cmdtlmserver/LabelvaluerangebarWidget-7pEykAm3-5dfe07da7d1638b771d3.js +0 -1
- data/tools/cmdtlmserver/Layout-BNvQKlyy-42669883439252bc6d22.js +0 -1
- data/tools/cmdtlmserver/LedWidget-_EA7ZKM8-1787942a8f24943d5f0c.js +0 -1
- data/tools/cmdtlmserver/LimitsbarWidget-DdoQf46y-a99c661845df64dcf68d.js +0 -1
- data/tools/cmdtlmserver/LimitscolorWidget-Cv0umnVo-3ebe584cf417b4b72ad0.js +0 -1
- data/tools/cmdtlmserver/LimitscolumnWidget-CnCQtxim-7d2c6a4a3ac5022d2e6b.js +0 -1
- data/tools/cmdtlmserver/LinegraphWidget-ekyQoR7x-6ccbac58fdd534b9d86e.js +0 -1
- data/tools/cmdtlmserver/MatrixbycolumnsWidget-IBUcGNF7-6e6e8ca8f95b59321550.js +0 -1
- data/tools/cmdtlmserver/ProgressbarWidget-CnveFZVh-39dfa34c59474909f2f1.js +0 -1
- data/tools/cmdtlmserver/RadiobuttonWidget-hWLrCb8W-4267747702f7f998ed48.js +0 -1
- data/tools/cmdtlmserver/RadiogroupWidget-DK1fphkh-4240a6df70fa8dca51a1.js +0 -1
- data/tools/cmdtlmserver/RangebarWidget-vspY8CGV-ebdba021106feba919b8.js +0 -1
- data/tools/cmdtlmserver/RawDialog-2e14a913b76847da4ba9.js +0 -11
- data/tools/cmdtlmserver/RollupWidget-07pNcXQV-ba5e4005c086c12c06ec.js +0 -1
- data/tools/cmdtlmserver/RoutersTab-4a1f6189bc2c16e48e45.js +0 -1
- data/tools/cmdtlmserver/ScrollwindowWidget-BcbyrYUo-10281c7d6b14389eed73.js +0 -1
- data/tools/cmdtlmserver/SignalWidget-BDp5sUHj-a65e9d98e5ee38497414.js +0 -1
- data/tools/cmdtlmserver/SpacerWidget-DcOnQ1yI-85ede0dfdaf5332a75b5.js +0 -1
- data/tools/cmdtlmserver/SparklineWidget-CVglnlAm-70c13afcad82b1af8856.js +0 -1
- data/tools/cmdtlmserver/StatusTab-81f0151e31400a845091.js +0 -1
- data/tools/cmdtlmserver/TabbookWidget-p51Oa7Ru-5c77c55d3ca8c8eea2a2.js +0 -1
- data/tools/cmdtlmserver/TargetsTab-d315b150506412fd940d.js +0 -1
- data/tools/cmdtlmserver/TextboxWidget-DM-XX97e-a610e3330b16f7d8c357.js +0 -1
- data/tools/cmdtlmserver/TextfieldWidget-7cYHAgH8-cc633ee5c7fdc2827af2.js +0 -1
- data/tools/cmdtlmserver/TimeWidget-EvQJyu6x-8891f75d3167aa20e23f.js +0 -1
- data/tools/cmdtlmserver/TitleWidget-6ddfJuqd-3bbefc62c80d7df57c87.js +0 -1
- data/tools/cmdtlmserver/TlmPacketsTab-572f438a925f8dc917d2.js +0 -1
- data/tools/cmdtlmserver/Updater-7264a034babccd19df9b.js +0 -1
- data/tools/cmdtlmserver/VWidget-P-X9ffkl-c8b72dc1178eb3c8e2cd.js +0 -1
- data/tools/cmdtlmserver/ValueWidget-DAUGuQ9f-5aefd22f107264b78496.js +0 -1
- data/tools/cmdtlmserver/ValuelimitsbarWidget-DmLUXw0I-a8b62fb2384528e1f282.js +0 -1
- data/tools/cmdtlmserver/ValuelimitscolumnWidget-DDmo8wHJ-452d429087199fd8fd8f.js +0 -1
- data/tools/cmdtlmserver/ValuerangebarWidget-CbzWSWq3-36e7a304c66d8858de05.js +0 -1
- data/tools/cmdtlmserver/VerticalWidget-BuKinn_c-22586ad6fe541c906104.js +0 -1
- data/tools/cmdtlmserver/VerticalboxWidget-C0zD5h0O-b1a55e28b18d8849b8ef.js +0 -1
- data/tools/cmdtlmserver/Widget-BIXl-Pk5-d010324d778e54fd1761.js +0 -1
- data/tools/cmdtlmserver/main-465ec4b7b5416a57d004.js +0 -1504
- data/tools/cmdtlmserver/services-fc57b62f64eeefd0928c.js +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
System.register([],(function(Ae,Kn){"use strict";return{execute:(function(){var sr=Object.defineProperty,nr=(t,e,r)=>e in t?sr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ue=(t,e,r)=>nr(t,typeof e!="symbol"?e+"":e,r);function Ge(t,e){return function(){return t.apply(e,arguments)}}const{toString:ir}=Object.prototype,{getPrototypeOf:Ce}=Object,{iterator:he,toStringTag:Qe}=Symbol,de=(t=>e=>{const r=ir.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),N=t=>(t=t.toLowerCase(),e=>de(e)===t),fe=t=>e=>typeof e===t,{isArray:V}=Array,K=fe("undefined");function te(t){return t!==null&&!K(t)&&t.constructor!==null&&!K(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ye=N("ArrayBuffer");function or(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ye(t.buffer),e}const cr=fe("string"),C=fe("function"),Ze=fe("number"),re=t=>t!==null&&typeof t=="object",ar=t=>t===!0||t===!1,pe=t=>{if(de(t)!=="object")return!1;const e=Ce(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Qe in t)&&!(he in t)},lr=t=>{if(!re(t)||te(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ur=N("Date"),hr=N("File"),dr=N("Blob"),fr=N("FileList"),pr=t=>re(t)&&C(t.pipe),gr=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||C(t.append)&&((e=de(t))==="formdata"||e==="object"&&C(t.toString)&&t.toString()==="[object FormData]"))},mr=N("URLSearchParams"),[br,yr,_r,wr]=["ReadableStream","Request","Response","Headers"].map(N),vr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function se(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),V(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{if(te(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 et(t,e){if(te(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 B=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tt=t=>!K(t)&&t!==B;function Te(){const{caseless:t,skipUndefined:e}=tt(this)&&this||{},r={},s=(n,i)=>{const o=t&&et(r,i)||i;pe(r[o])&&pe(n)?r[o]=Te(r[o],n):pe(n)?r[o]=Te({},n):V(n)?r[o]=n.slice():(!e||!K(n))&&(r[o]=n)};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&se(arguments[n],s);return r}const Sr=(t,e,r,{allOwnKeys:s}={})=>(se(e,(n,i)=>{r&&C(n)?t[i]=Ge(n,r):t[i]=n},{allOwnKeys:s}),t),Er=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),xr=(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)},Or=(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&&Ce(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Rr=(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},Ar=t=>{if(!t)return null;if(V(t))return t;let e=t.length;if(!Ze(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Cr=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ce(Uint8Array)),Tr=(t,e)=>{const r=(t&&t[he]).call(t);let s;for(;(s=r.next())&&!s.done;){const n=s.value;e.call(t,n[0],n[1])}},kr=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},jr=N("HTMLFormElement"),Pr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,r,s){return r.toUpperCase()+s}),rt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ir=N("RegExp"),st=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};se(r,(n,i)=>{let o;(o=e(n,i,t))!==!1&&(s[i]=o||n)}),Object.defineProperties(t,s)},Nr=t=>{st(t,(e,r)=>{if(C(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const s=t[r];if(C(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+"'")})}})},Lr=(t,e)=>{const r={},s=n=>{n.forEach(i=>{r[i]=!0})};return V(t)?s(t):s(String(t).split(e)),r},Ur=()=>{},Fr=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function $r(t){return!!(t&&C(t.append)&&t[Qe]==="FormData"&&t[he])}const qr=t=>{const e=new Array(10),r=(s,n)=>{if(re(s)){if(e.indexOf(s)>=0)return;if(te(s))return s;if(!("toJSON"in s)){e[n]=s;const i=V(s)?[]:{};return se(s,(o,c)=>{const l=r(o,n+1);!K(l)&&(i[c]=l)}),e[n]=void 0,i}}return s};return r(t,0)},Dr=N("AsyncFunction"),Br=t=>t&&(re(t)||C(t))&&C(t.then)&&C(t.catch),nt=((t,e)=>t?setImmediate:e?((r,s)=>(B.addEventListener("message",({source:n,data:i})=>{n===B&&i===r&&s.length&&s.shift()()},!1),n=>{s.push(n),B.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",C(B.postMessage)),Mr=typeof queueMicrotask<"u"?queueMicrotask.bind(B):typeof process<"u"&&process.nextTick||nt,zr=t=>t!=null&&C(t[he]),a={isArray:V,isArrayBuffer:Ye,isBuffer:te,isFormData:gr,isArrayBufferView:or,isString:cr,isNumber:Ze,isBoolean:ar,isObject:re,isPlainObject:pe,isEmptyObject:lr,isReadableStream:br,isRequest:yr,isResponse:_r,isHeaders:wr,isUndefined:K,isDate:ur,isFile:hr,isBlob:dr,isRegExp:Ir,isFunction:C,isStream:pr,isURLSearchParams:mr,isTypedArray:Cr,isFileList:fr,forEach:se,merge:Te,extend:Sr,trim:vr,stripBOM:Er,inherits:xr,toFlatObject:Or,kindOf:de,kindOfTest:N,endsWith:Rr,toArray:Ar,forEachEntry:Tr,matchAll:kr,isHTMLForm:jr,hasOwnProperty:rt,hasOwnProp:rt,reduceDescriptors:st,freezeMethods:Nr,toObjectSet:Lr,toCamelCase:Pr,noop:Ur,toFiniteNumber:Fr,findKey:et,global:B,isContextDefined:tt,isSpecCompliantForm:$r,toJSONObject:qr,isAsyncFn:Dr,isThenable:Br,setImmediate:nt,asap:Mr,isIterable:zr};function y(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(y,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 it=y.prototype,ot={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ot[t]={value:t}}),Object.defineProperties(y,ot),Object.defineProperty(it,"isAxiosError",{value:!0}),y.from=(t,e,r,s,n,i)=>{const o=Object.create(it);a.toFlatObject(t,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError");const c=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return y.call(o,c,l,r,s,n),t&&o.cause==null&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",i&&Object.assign(o,i),o};const Hr=null;function ke(t){return a.isPlainObject(t)||a.isArray(t)}function ct(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function at(t,e,r){return t?t.concat(e).map(function(s,n){return s=ct(s),!r&&n?"["+s+"]":s}).join(r?".":""):e}function Wr(t){return a.isArray(t)&&!t.some(ke)}const Jr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ge(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(f,p){return!a.isUndefined(p[f])});const s=r.metaTokens,n=r.visitor||u,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 l(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!c&&a.isBlob(f))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?c&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,p,d){let v=f;if(f&&!d&&typeof f=="object"){if(a.endsWith(p,"{}"))p=s?p:p.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Wr(f)||(a.isFileList(f)||a.endsWith(p,"[]"))&&(v=a.toArray(f)))return p=ct(p),v.forEach(function(S,w){!(a.isUndefined(S)||S===null)&&e.append(o===!0?at([p],w,i):o===null?p:p+"[]",l(S))}),!1}return ke(f)?!0:(e.append(at(d,p,i),l(f)),!1)}const h=[],g=Object.assign(Jr,{defaultVisitor:u,convertValue:l,isVisitable:ke});function m(f,p){if(!a.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(f),a.forEach(f,function(d,v){(!(a.isUndefined(d)||d===null)&&n.call(e,d,a.isString(v)?v.trim():v,p,g))===!0&&m(d,p?p.concat(v):[v])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return m(t),e}function lt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function je(t,e){this._pairs=[],t&&ge(t,this,e)}const ut=je.prototype;ut.append=function(t,e){this._pairs.push([t,e])},ut.toString=function(t){const e=t?function(r){return t.call(this,r,lt)}:lt;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function Vr(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(t,e,r){if(!e)return t;const s=r&&r.encode||Vr;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 je(e,r).toString(s),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class dt{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 ft={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Kr=typeof URLSearchParams<"u"?URLSearchParams:je,Xr=typeof FormData<"u"?FormData:null,Gr=typeof Blob<"u"?Blob:null,Qr={isBrowser:!0,classes:{URLSearchParams:Kr,FormData:Xr,Blob:Gr},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",Ie=typeof navigator=="object"&&navigator||void 0,Yr=Pe&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),Zr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",es=Pe&&window.location.href||"http://localhost",ts=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:Yr,hasStandardBrowserWebWorkerEnv:Zr,navigator:Ie,origin:es},Symbol.toStringTag,{value:"Module"})),O={...ts,...Qr};function rs(t,e){return ge(t,new O.classes.URLSearchParams,{visitor:function(r,s,n,i){return O.isNode&&a.isBuffer(r)?(this.append(s,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function ss(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ns(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 pt(t){function e(r,s,n,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),l=i>=r.length;return o=!o&&a.isArray(n)?n.length:o,l?(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]=ns(n[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const r={};return a.forEachEntry(t,(s,n)=>{e(ss(s),n,r,0)}),r}return null}function is(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 ne={transitional:ft,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(pt(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 rs(t,this.formSerializer).toString();if((i=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ge(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return n||s?(e.setContentType("application/json",!1),is(t)):t}],transformResponse:[function(t){const e=this.transitional||ne.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,this.parseReviver)}catch(i){if(n)throw i.name==="SyntaxError"?y.from(i,y.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:O.classes.FormData,Blob:O.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=>{ne.headers[t]={}});const os=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"]),cs=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]&&os[r])&&(r==="set-cookie"?e[r]?e[r].push(s):e[r]=[s]:e[r]=e[r]?e[r]+", "+s:s)}),e},gt=Symbol("internals");function ie(t){return t&&String(t).trim().toLowerCase()}function me(t){return t===!1||t==null?t:a.isArray(t)?t.map(me):String(t)}function as(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 ls=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ne(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 us(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function hs(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 T=class{constructor(t){t&&this.set(t)}set(t,e,r){const s=this;function n(o,c,l){const u=ie(c);if(!u)throw new Error("header name must be a non-empty string");const h=a.findKey(s,u);(!h||s[h]===void 0||l===!0||l===void 0&&s[h]!==!1)&&(s[h||c]=me(o))}const i=(o,c)=>a.forEach(o,(l,u)=>n(l,u,c));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(a.isString(t)&&(t=t.trim())&&!ls(t))i(cs(t),e);else if(a.isObject(t)&&a.isIterable(t)){let o={},c,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(c=o[l])?a.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(o,e)}else t!=null&&n(e,t,r);return this}get(t,e){if(t=ie(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!e)return s;if(e===!0)return as(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=ie(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!e||Ne(this,this[r],r,e)))}return!1}delete(t,e){const r=this;let s=!1;function n(i){if(i=ie(i),i){const o=a.findKey(r,i);o&&(!e||Ne(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||Ne(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]=me(s),delete e[n];return}const o=t?us(n):String(n).trim();o!==n&&delete e[n],e[o]=me(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[gt]=this[gt]={accessors:{}}).accessors,r=this.prototype;function s(n){const i=ie(n);e[i]||(hs(r,n),e[i]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(T.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),a.freezeMethods(T);function Le(t,e){const r=this||ne,s=e||r,n=T.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 mt(t){return!!(t&&t.__CANCEL__)}function X(t,e,r){y.call(this,t??"canceled",y.ERR_CANCELED,e,r),this.name="CanceledError"}a.inherits(X,y,{__CANCEL__:!0});function bt(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new y("Request failed with status code "+r.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ds(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function fs(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 l=Date.now(),u=s[i];o||(o=l),r[n]=c,s[n]=l;let h=i,g=0;for(;h!==n;)g+=r[h++],h=h%t;if(n=(n+1)%t,n===i&&(i=(i+1)%t),l-o<e)return;const m=u&&l-u;return m?Math.round(g*1e3/m):void 0}}function ps(t,e){let r=0,s=1e3/e,n,i;const o=(c,l=Date.now())=>{r=l,n=null,i&&(clearTimeout(i),i=null),t(...c)};return[(...c)=>{const l=Date.now(),u=l-r;u>=s?o(c,l):(n=c,i||(i=setTimeout(()=>{i=null,o(n)},s-u)))},()=>n&&o(n)]}const be=(t,e,r=3)=>{let s=0;const n=fs(50,250);return ps(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,l=o-s,u=n(l),h=o<=c;s=o;const g={loaded:o,total:c,progress:c?o/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&h?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(g)},r)},yt=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},_t=t=>(...e)=>a.asap(()=>t(...e)),gs=O.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,O.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,ms=O.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 bs(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function ys(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wt(t,e,r){let s=!bs(e);return t&&(s||r==!1)?ys(t,e):e}const vt=t=>t instanceof T?{...t}:t;function M(t,e){e=e||{};const r={};function s(u,h,g,m){return a.isPlainObject(u)&&a.isPlainObject(h)?a.merge.call({caseless:m},u,h):a.isPlainObject(h)?a.merge({},h):a.isArray(h)?h.slice():h}function n(u,h,g,m){if(a.isUndefined(h)){if(!a.isUndefined(u))return s(void 0,u,g,m)}else return s(u,h,g,m)}function i(u,h){if(!a.isUndefined(h))return s(void 0,h)}function o(u,h){if(a.isUndefined(h)){if(!a.isUndefined(u))return s(void 0,u)}else return s(void 0,h)}function c(u,h,g){if(g in e)return s(u,h);if(g in t)return s(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,h,g)=>n(vt(u),vt(h),g,!0)};return a.forEach(Object.keys({...t,...e}),function(u){const h=l[u]||n,g=h(t[u],e[u],u);a.isUndefined(g)&&h!==c||(r[u]=g)}),r}const St=t=>{const e=M({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:i,headers:o,auth:c}=e;if(e.headers=o=T.from(o),e.url=ht(wt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const l=r.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([h,g])=>{u.includes(h.toLowerCase())&&o.set(h,g)})}}if(O.hasStandardBrowserEnv&&(s&&a.isFunction(s)&&(s=s(e)),s||s!==!1&&gs(e.url))){const l=n&&i&&ms.read(i);l&&o.set(n,l)}return e},_s=typeof XMLHttpRequest<"u",ws=_s&&function(t){return new Promise(function(e,r){const s=St(t);let n=s.data;const i=T.from(s.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:l}=s,u,h,g,m,f;function p(){m&&m(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(s.method.toUpperCase(),s.url,!0),d.timeout=s.timeout;function v(){if(!d)return;const w=T.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),A={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:w,config:t,request:d};bt(function(j){e(j),p()},function(j){r(j),p()},A),d=null}"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(v)},d.onabort=function(){d&&(r(new y("Request aborted",y.ECONNABORTED,t,d)),d=null)},d.onerror=function(w){const A=w&&w.message?w.message:"Network Error",j=new y(A,y.ERR_NETWORK,t,d);j.event=w||null,r(j),d=null},d.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||ft;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),r(new y(w,A.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,d)),d=null},n===void 0&&i.setContentType(null),"setRequestHeader"in d&&a.forEach(i.toJSON(),function(w,A){d.setRequestHeader(A,w)}),a.isUndefined(s.withCredentials)||(d.withCredentials=!!s.withCredentials),o&&o!=="json"&&(d.responseType=s.responseType),l&&([g,f]=be(l,!0),d.addEventListener("progress",g)),c&&d.upload&&([h,m]=be(c),d.upload.addEventListener("progress",h),d.upload.addEventListener("loadend",m)),(s.cancelToken||s.signal)&&(u=w=>{d&&(r(!w||w.type?new X(null,t,d):w),d.abort(),d=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const S=ds(s.url);if(S&&O.protocols.indexOf(S)===-1){r(new y("Unsupported protocol "+S+":",y.ERR_BAD_REQUEST,t));return}d.send(n||null)})},vs=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,n;const i=function(u){if(!n){n=!0,c();const h=u instanceof Error?u:this.reason;s.abort(h instanceof y?h:new X(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,i(new y(`timeout ${e} of ms exceeded`,y.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=s;return l.unsubscribe=()=>a.asap(c),l}},Ss=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},Es=async function*(t,e){for await(const r of xs(t))yield*Ss(r,e)},xs=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()}},Et=(t,e,r,s)=>{const n=Es(t,e);let i=0,o,c=l=>{o||(o=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await n.next();if(u){c(),l.close();return}let g=h.byteLength;if(r){let m=i+=g;r(m)}l.enqueue(new Uint8Array(h))}catch(u){throw c(u),u}},cancel(l){return c(l),n.return()}},{highWaterMark:2})},xt=64*1024,{isFunction:ye}=a,Ot=(({fetch:t,Request:e,Response:r})=>({fetch:t,Request:e,Response:r}))(a.global),{ReadableStream:Rt,TextEncoder:At}=a.global,Ct=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Os=t=>{const{fetch:e,Request:r,Response:s}=Object.assign({},Ot,t),n=ye(e),i=ye(r),o=ye(s);if(!n)return!1;const c=n&&ye(Rt),l=n&&(typeof At=="function"?(p=>d=>p.encode(d))(new At):async p=>new Uint8Array(await new r(p).arrayBuffer())),u=i&&c&&Ct(()=>{let p=!1;const d=new r(O.origin,{body:new Rt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!d}),h=o&&c&&Ct(()=>a.isReadableStream(new s("").body)),g={stream:h&&(p=>p.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!g[p]&&(g[p]=(d,v)=>{let S=d&&d[p];if(S)return S.call(d);throw new y(`Response type '${p}' is not supported`,y.ERR_NOT_SUPPORT,v)})});const m=async p=>{if(p==null)return 0;if(a.isBlob(p))return p.size;if(a.isSpecCompliantForm(p))return(await new r(O.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(a.isArrayBufferView(p)||a.isArrayBuffer(p))return p.byteLength;if(a.isURLSearchParams(p)&&(p=p+""),a.isString(p))return(await l(p)).byteLength},f=async(p,d)=>a.toFiniteNumber(p.getContentLength())??m(d);return async p=>{let{url:d,method:v,data:S,signal:w,cancelToken:A,timeout:j,onDownloadProgress:$,onUploadProgress:Q,responseType:P,headers:J,withCredentials:U="same-origin",fetchOptions:Y}=St(p);P=P?(P+"").toLowerCase():"text";let R=vs([w,A&&A.toAbortSignal()],j),I=null;const E=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let b;try{if(Q&&u&&v!=="get"&&v!=="head"&&(b=await f(J,S))!==0){let D=new r(d,{method:"POST",body:S,duplex:"half"}),ee;if(a.isFormData(S)&&(ee=D.headers.get("content-type"))&&J.setContentType(ee),D.body){const[Xe,Re]=yt(b,be(_t(Q)));S=Et(D.body,xt,Xe,Re)}}a.isString(U)||(U=U?"include":"omit");const _=i&&"credentials"in r.prototype,q={...Y,signal:R,method:v.toUpperCase(),headers:J.normalize().toJSON(),body:S,duplex:"half",credentials:_?U:void 0};I=i&&new r(d,q);let k=await(i?e(I,Y):e(d,q));const Z=h&&(P==="stream"||P==="response");if(h&&($||Z&&E)){const D={};["status","statusText","headers"].forEach(tr=>{D[tr]=k[tr]});const ee=a.toFiniteNumber(k.headers.get("content-length")),[Xe,Re]=$&&yt(ee,be(_t($),!0))||[];k=new s(Et(k.body,xt,Xe,()=>{Re&&Re(),E&&E()}),D)}P=P||"text";let Vn=await g[a.findKey(g,P)||"text"](k,p);return!Z&&E&&E(),await new Promise((D,ee)=>{bt(D,ee,{data:Vn,headers:T.from(k.headers),status:k.status,statusText:k.statusText,config:p,request:I})})}catch(_){throw E&&E(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,p,I),{cause:_.cause||_}):y.from(_,_&&_.code,p,I)}}},Rs=new Map,Tt=t=>{let e=a.merge.call({skipUndefined:!0},Ot,t?t.env:null);const{fetch:r,Request:s,Response:n}=e,i=[s,n,r];let o=i.length,c=o,l,u,h=Rs;for(;c--;)l=i[c],u=h.get(l),u===void 0&&h.set(l,u=c?new Map:Os(e)),h=u;return u};Tt();const Ue={http:Hr,xhr:ws,fetch:{get:Tt}};a.forEach(Ue,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const kt=t=>`- ${t}`,As=t=>a.isFunction(t)||t===null||t===!1,jt={getAdapter:(t,e)=>{t=a.isArray(t)?t:[t];const{length:r}=t;let s,n;const i={};for(let o=0;o<r;o++){s=t[o];let c;if(n=s,!As(s)&&(n=Ue[(c=String(s)).toLowerCase()],n===void 0))throw new y(`Unknown adapter '${c}'`);if(n&&(a.isFunction(n)||(n=n.get(e))))break;i[c||"#"+o]=n}if(!n){const o=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=r?o.length>1?`since :
|
|
4
|
-
`+o.map(kt).join(`
|
|
5
|
-
`):" "+kt(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return n},adapters:Ue};function Fe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new X(null,t)}function Pt(t){return Fe(t),t.headers=T.from(t.headers),t.data=Le.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jt.getAdapter(t.adapter||ne.adapter,t)(t).then(function(e){return Fe(t),e.data=Le.call(t,t.transformResponse,e),e.headers=T.from(e.headers),e},function(e){return mt(e)||(Fe(t),e&&e.response&&(e.response.data=Le.call(t,t.transformResponse,e.response),e.response.headers=T.from(e.response.headers))),Promise.reject(e)})}const It="1.12.0",_e={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{_e[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Nt={};_e.transitional=function(t,e,r){function s(n,i){return"[Axios v"+It+"] Transitional option '"+n+"'"+i+(r?". "+r:"")}return(n,i,o)=>{if(t===!1)throw new y(s(i," has been removed"+(e?" in "+e:"")),y.ERR_DEPRECATED);return e&&!Nt[i]&&(Nt[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}},_e.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Cs(t,e,r){if(typeof t!="object")throw new y("options must be an object",y.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],l=c===void 0||o(c,i,t);if(l!==!0)throw new y("option "+i+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const we={assertOptions:Cs,validators:_e},F=we.validators;let z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dt,response:new dt}}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=M(this.defaults,e);const{transitional:r,paramsSerializer:s,headers:n}=e;r!==void 0&&we.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?e.paramsSerializer={serialize:s}:we.assertOptions(s,{encode:F.function,serialize:F.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),we.assertOptions(e,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.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"],f=>{delete n[f]}),e.headers=T.concat(i,n);const o=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(c=c&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,h=0,g;if(!c){const f=[Pt.bind(this),void 0];for(f.unshift(...o),f.push(...l),g=f.length,u=Promise.resolve(e);h<g;)u=u.then(f[h++],f[h++]);return u}g=o.length;let m=e;for(h=0;h<g;){const f=o[h++],p=o[h++];try{m=f(m)}catch(d){p.call(this,d);break}}try{u=Pt.call(this,m)}catch(f){return Promise.reject(f)}for(h=0,g=l.length;h<g;)u=u.then(l[h++],l[h++]);return u}getUri(t){t=M(this.defaults,t);const e=wt(t.baseURL,t.url,t.allowAbsoluteUrls);return ht(e,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){z.prototype[t]=function(e,r){return this.request(M(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(M(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}z.prototype[t]=e(),z.prototype[t+"Form"]=e(!0)});let Ts=class rr{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 X(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 rr(function(r){e=r}),cancel:e}}};function ks(t){return function(e){return t.apply(null,e)}}function js(t){return a.isObject(t)&&t.isAxiosError===!0}const $e={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($e).forEach(([t,e])=>{$e[e]=t});function Lt(t){const e=new z(t),r=Ge(z.prototype.request,e);return a.extend(r,z.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return Lt(M(t,s))},r}const x=Lt(ne);x.Axios=z,x.CanceledError=X,x.CancelToken=Ts,x.isCancel=mt,x.VERSION=It,x.toFormData=ge,x.AxiosError=y,x.Cancel=x.CanceledError,x.all=function(t){return Promise.all(t)},x.spread=ks,x.isAxiosError=js,x.mergeConfig=M,x.AxiosHeaders=T,x.formToJSON=t=>pt(a.isHTMLForm(t)?new FormData(t):t),x.getAdapter=jt.getAdapter,x.HttpStatusCode=$e,x.default=x;const{Axios:Xn,AxiosError:Gn,CanceledError:Qn,isCancel:Yn,CancelToken:Zn,VERSION:ei,all:ti,Cancel:ri,isAxiosError:si,spread:ni,toFormData:ii,AxiosHeaders:oi,HttpStatusCode:ci,formToJSON:ai,getAdapter:li,mergeConfig:ui}=x,qe=x.create({baseURL:location.origin,timeout:6e4,params:{}});qe.interceptors.response.use(t=>t,t=>{var e,r,s,n,i,o,c,l,u,h,g;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(p){p&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let m=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(m+=`${t.response.statusText} `),(s=(r=t.response)==null?void 0:r.config)!=null&&s.data&&(m+=`${t.response.config.data} `),(i=(n=t.response)==null?void 0:n.data)!=null&&i.message?m+=`${t.response.data.message}`:(c=(o=t.response)==null?void 0:o.data)!=null&&c.exception?m+=`${t.response.data.exception}`:(h=(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.error)!=null&&h.message?(t.response.data.error.class&&(m+=`${t.response.data.error.class} `),m+=`${t.response.data.error.message}`):m+=`${(g=t.response)==null?void 0:g.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:m}),t}else throw t});const ve=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),qe({method:t,url:e,data:r,params:s,headers:n,onUploadProgress:c})},De={Accept:"application/json"},Ut={...De,"Content-Type":"application/json"},hi=Ae("h",{get:function(t,{params:e,headers:r=De,noScope:s,noAuth:n,onUploadProgress:i}={}){return ve("get",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:i})},put:function(t,{data:e,params:r,headers:s=Ut,noScope:n,noAuth:i,onUploadProgress:o}={}){return ve("put",t,{data:e,params:r,headers:s,noScope:n,noAuth:i,onUploadProgress:o})},post:function(t,{data:e,params:r,headers:s=Ut,noScope:n,noAuth:i,onUploadProgress:o}={}){return ve("post",t,{data:e,params:r,headers:s,noScope:n,noAuth:i,onUploadProgress:o})},delete:function(t,{params:e,headers:r=De,noScope:s,noAuth:n,onUploadProgress:i}={}){return ve("delete",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:i})}});let Se=()=>({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 oe extends Error{constructor(e,r){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=r,this.name="ReasonError"}}class Be extends oe{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Ps extends oe{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class L extends oe{constructor(e,r){r?super(e,r):super("Disconnected",e),this.name="DisconnectedError"}}class Is extends L{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Ft(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 Ns{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 H=Symbol("state");class $t{constructor(e={}){this.emitter=Se(),this.params=Object.freeze(e),this.presence=new Ns(this),this.initialConnect=!0,this[H]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Ft({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[H]}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[H]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[H]="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[H]="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[H]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[H]="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 oe("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Ls{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 Us{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 Fs{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new Us),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 Ls(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 $s{constructor(e={}){this.subscriptions=new Fs(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 qt={debug:0,info:1,warn:2,error:3};class Dt{constructor(e){this.level=e||"warn"}log(e,r,s){qt[e]<qt[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 ce extends Dt{writeLogEntry(){}}class qs{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Ds=0;class Bt{constructor(e={}){let{logger:r}=e;this.logger=r||new ce,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=Ft(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 l=++Ds;this.pendingSubscriptions[n]={resolve:o,reject:c,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,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 Ps(`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 L(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 Be)):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 Mt=()=>Date.now()/1e3|0;class Bs extends Bt{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=Mt()),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=Mt()),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 Ms extends oe{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Me extends $t{constructor(e,r){super(r),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ue(Me,"identifier","__ghost__");const zs="$pubsub";class ze extends $t{async perform(e,r){if(e.startsWith("$"))return super.perform(e,r);throw Error("not implemented")}}ue(ze,"identifier",zs);const W=Symbol("state");let Hs=class{constructor({transport:t,protocol:e,encoder:r,logger:s,lazy:n,hubOptions:i,performFailures:o,transportConfigurator:c}){this.emitter=Se(),this.transport=t,this.encoder=r,this.logger=s||new ce,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new $s(i||{}),this[W]="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[W]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[W]="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[W]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new L("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[W]="connected",this.hub.subscriptions.all().forEach(s=>{t&&s.remoteId&&t.includes(s.remoteId)?s.notify("restored"):(s.notify("disconnected",new L("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 L(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[W]="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 L?t:new L(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[W]="closed";let r=e||new L("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 ze({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new ze({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let r,s;return typeof t=="string"&&(s=t,t=Me),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 Be&&this.logger.warn("rejected",i),o instanceof L){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 L?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 Ms;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 Ws={maxMissingPings:2,maxReconnectAttempts:1/0},G=()=>Date.now(),zt=(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,l=o+(c-o)*Math.random(),u=2*(Math.random()-.5)*s;return l=l*(1+u),n&&n<l&&(l=n),l}};let Ht=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},Ws,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 ce,this.state="pending_connect",this.attempts=0,this.disconnectedAt=G()}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=G(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=G(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=G(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=G()})),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=G()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new Is))}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 Js{constructor(e,r={}){this.transports=e,this.transport=null,this.emitter=Se(),this.unbind=[],this.logger=r.logger||new ce}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 Vs{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=Se();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 Wt={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Ks(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({},Wt,e);let{protocol:r,websocketImplementation:s,websocketFormat:n,websocketOptions:i,websocketAuthStrategy:o,fallbacks:c,logLevel:l,logger:u,transport:h,encoder:g,lazy:m,monitor:f,pingInterval:p,reconnectStrategy:d,maxMissingPings:v,maxReconnectAttempts:S,subprotocol:w,tokenRefresher:A,historyTimestamp:j,protocolOptions:$,concurrentSubscribes:Q,performFailures:P,transportConfigurator:J,auth:U}=e;if(u=u||new ce(l),typeof r=="string"){w=w||r;let I=r.substring(0,r.lastIndexOf("-")),E=r.substring(r.lastIndexOf("-")+1);if($=$||{},I==="actioncable-v1")r=new Bt({logger:u,...$});else if(I==="actioncable-v1-ext")r=new Bs({logger:u,historyTimestamp:j,...$});else throw Error(`Protocol is not supported yet: ${r}`);if(E==="json")g=g||new qs,n=n||"text";else if(E==="msgpack"){if(n="binary",!g)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(E==="protobuf"){if(n=n||"binary",!g)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 Vs(t,{websocketImplementation:s,websocketOptions:i,subprotocol:w,authStrategy:o,format:n}),c&&(h=new Js([h,...c],{logger:u})),U&&U.token&&h.setToken(U.token,U.param||"jid"),d=d||zt(p),f!==!1&&(f=f||new Ht({pingInterval:p,reconnectStrategy:d,maxMissingPings:v,maxReconnectAttempts:S,logger:u}));let Y={concurrentSubscribes:Q},R=new Hs({protocol:r,transport:h,encoder:g,logger:u,lazy:m,hubOptions:Y,performFailures:P,transportConfigurator:J});return f&&(f.watch(R),R.monitor=f),A&&Xs(R,async()=>{try{await A(h)}catch(I){return u.error("Failed to refresh authentication token: "+I),!1}return R.connect().catch(()=>{}),!0}),R}function Xs(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 Gs{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 Qs extends Me{constructor(e,r,s){super(e,r),this.subscription=new Gs(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 Be?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Ys{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 Qs(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 Zs{constructor(e){this.cable=e,this.subscriptions=new Ys(e)}}class en extends Dt{writeLogEntry(e,r,s){s?console[e](r,s):console[e](r)}}class tn extends Ht{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 L("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 rn=["cable","action-cable"],sn="/cable",Ee=(t,e)=>{for(let r of rn){let s=t.head.querySelector(`meta[name='${r}-${e}']`);if(s)return s.getAttribute("content")}},Jt=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,nn=()=>{if(typeof document<"u"&&document.head){let t=Ee(document,"url");if(t)return Jt(t)}return Jt(sn)},on=()=>{if(typeof document<"u"&&document.head){let t=Ee(document,"history-timestamp");if(t)return t|0}},cn=()=>{if(typeof document<"u"&&document.head)return Ee(document,"token")},an=()=>{if(typeof document<"u"&&document.head)return Ee(document,"token-param")};function ln(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||nn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=on());let r=cn();if(r){let u=an();e.auth=Object.assign({token:r,param:u},e.auth||{})}e=Object.assign({},Wt,e);let{logLevel:s,logger:n,pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new en(s),o=e.reconnectStrategy=e.reconnectStrategy||zt(i),e.monitor!==!1&&(e.monitor=e.monitor||new tn({pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:l,logger:n})),Ks(t,e)}function un(t,e){let r=ln(t,e);return new Zs(r)}class hn{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(r)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=un(o)}return this._cable.subscriptions.create({channel:e,...n},s)})}recordPing(){}}Ae("p",hn);function ae(t){return dn.test(t)}const dn=/^-?[0-9]+$/;function Vt(t){return fn.test(t)}const fn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Kt(t,e){if(ae(t))return Number.isSafeInteger(Number.parseInt(t,10));const r=Number.parseFloat(t),s=String(r);if(t===s)return!0;const n=Xt(t),i=Xt(s);return!!(n===i||(e==null?void 0:e.approx)===!0&&!ae(t)&&i.length>=14&&n.startsWith(i.substring(0,14)))}let le=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function pn(t){if(Kt(t,{approx:!1}))return;if(ae(t))return le.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?le.underflow:le.truncate_float:le.overflow}function Xt(t){const{start:e,end:r}=gn(t),s=t.substring(e,r),n=s.indexOf(".");return n===-1?s:s.substring(0,n)+s.substring(n+1)}function gn(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 mn{constructor(e){if(ue(this,"isLosslessNumber",!0),!Vt(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=pn(this.value);if(e===void 0||e===le.truncate_float)return Number.parseFloat(this.value);if(ae(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 bn(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function yn(t){return new mn(t)}function _n(t,e){return He({"":t},"",t,e)}function He(t,e,r,s){return Array.isArray(r)?s.call(t,e,vn(r,s)):r&&typeof r=="object"&&!bn(r)?s.call(t,e,wn(r,s)):s.call(t,e,r)}function wn(t,e){for(const r of Object.keys(t)){const s=He(t,r,t[r],e);s!==void 0?t[r]=s:delete t[r]}return t}function vn(t,e){for(let r=0;r<t.length;r++)t[r]=He(t,String(r),t[r],e);return t}function Sn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yn,s=0;const n=c();return p(n),v(),e?_n(n,e):n;function i(){if(t.charCodeAt(s)===Cn){s++,u();const b={};let _=!0;for(;s<t.length&&t.charCodeAt(s)!==Qt;){_?_=!1:(m(),u());const q=s,k=h();if(k===void 0){A();return}u(),f();const Z=c();if(Z===void 0){U();return}Object.prototype.hasOwnProperty.call(b,k)&&!We(Z,b[k])&&j(k,q+1),b[k]=Z}return t.charCodeAt(s)!==Qt&&$(),s++,b}}function o(){if(t.charCodeAt(s)===Tn){s++,u();const b=[];let _=!0;for(;s<t.length&&t.charCodeAt(s)!==Yt;){_?_=!1:m();const q=c();d(q),b.push(q)}return t.charCodeAt(s)!==Yt&&Q(),s++,b}}function c(){u();const b=h()??g()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),b}function l(b,_){if(t.slice(s,s+b.length)===b)return s+=b.length,_}function u(){for(;En(t.charCodeAt(s));)s++}function h(){if(t.charCodeAt(s)===Je){s++;let b="";for(;s<t.length&&t.charCodeAt(s)!==Je;){if(t.charCodeAt(s)===An){const _=t[s+1],q=Rn[_];q!==void 0?(b+=q,s++):_==="u"?xe(t.charCodeAt(s+2))&&xe(t.charCodeAt(s+3))&&xe(t.charCodeAt(s+4))&&xe(t.charCodeAt(s+5))?(b+=String.fromCharCode(Number.parseInt(t.slice(s+2,s+6),16)),s+=5):Y(s):J(s)}else On(t.charCodeAt(s))?b+=t[s]:P(t[s]);s++}return w(),s++,b}}function g(){const b=s;if(t.charCodeAt(s)===Zt&&(s++,S(b)),t.charCodeAt(s)===Ve)s++;else if(xn(t.charCodeAt(s)))for(s++;Oe(t.charCodeAt(s));)s++;if(t.charCodeAt(s)===Fn)for(s++,S(b);Oe(t.charCodeAt(s));)s++;if(t.charCodeAt(s)===Mn||t.charCodeAt(s)===Bn)for(s++,(t.charCodeAt(s)===Zt||t.charCodeAt(s)===Nn)&&s++,S(b);Oe(t.charCodeAt(s));)s++;if(s>b)return r(t.slice(b,s))}function m(){if(t.charCodeAt(s)!==Un)throw new SyntaxError(`Comma ',' expected after value ${E()}`);s++}function f(){if(t.charCodeAt(s)!==$n)throw new SyntaxError(`Colon ':' expected after property name ${E()}`);s++}function p(b){if(b===void 0)throw new SyntaxError(`JSON value expected ${E()}`)}function d(b){if(b===void 0)throw new SyntaxError(`Array item expected ${E()}`)}function v(){if(s<t.length)throw new SyntaxError(`Expected end of input ${E()}`)}function S(b){if(!Oe(t.charCodeAt(s))){const _=t.slice(b,s);throw new SyntaxError(`Invalid number '${_}', expecting a digit ${E()}`)}}function w(){if(t.charCodeAt(s)!==Je)throw new SyntaxError(`End of string '"' expected ${E()}`)}function A(){throw new SyntaxError(`Quoted object key expected ${E()}`)}function j(b,_){throw new SyntaxError(`Duplicate key '${b}' encountered at position ${_}`)}function $(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${E()}`)}function Q(){throw new SyntaxError(`Array item or end of array ']' expected ${E()}`)}function P(b){throw new SyntaxError(`Invalid character '${b}' ${R()}`)}function J(b){const _=t.slice(b,b+2);throw new SyntaxError(`Invalid escape character '${_}' ${R()}`)}function U(){throw new SyntaxError(`Object value expected after ':' ${R()}`)}function Y(b){const _=t.slice(b,b+6);throw new SyntaxError(`Invalid unicode character '${_}' ${R()}`)}function R(){return`at position ${s}`}function I(){return s<t.length?`but got '${t[s]}'`:"but reached end of input"}function E(){return`${I()} ${R()}`}}function En(t){return t===kn||t===jn||t===Pn||t===In}function xe(t){return t>=Ve&&t<=Ke||t>=qn&&t<=zn||t>=Dn&&t<=Hn}function Oe(t){return t>=Ve&&t<=Ke}function xn(t){return t>=Ln&&t<=Ke}function On(t){return t>=32&&t<=1114111}function We(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>We(r,e[s])):Gt(t)&&Gt(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(r=>We(t[r],e[r])):!1}function Gt(t){return typeof t=="object"&&t!==null}const Rn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
7
|
-
`,r:"\r",t:" "},An=92,Cn=123,Qt=125,Tn=91,Yt=93,kn=32,jn=10,Pn=9,In=13,Je=34,Nn=43,Zt=45,Ve=48,Ln=49,Ke=57,Un=44,Fn=46,$n=58,qn=65,Dn=97,Bn=69,Mn=101,zn=70,Hn=102;function er(t,e,r,s){return n(t);function n(l,u){if(Array.isArray(s)){const h=s.find(g=>g.test(l));if(h){const g=h.stringify(l);if(typeof g!="string"||!Vt(g))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${g})`);return g}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return i(l);if(l&&typeof l=="object")return o(l)}function i(l,u){if(l.length===0)return"[]";let h="[";for(let g=0;g<l.length;g++){const m=l[g];typeof m<"u"&&typeof m!="function"?h+=n(m):h+="null",g<l.length-1&&(h+=",")}return h+="]",h}function o(l,u){if(typeof l.toJSON=="function")return er(l.toJSON(),e,r,void 0);const h=Array.isArray(e)?e.map(String):Object.keys(l);if(h.length===0)return"{}";let g=!0,m="{";for(const f of h){const p=l[f];if(c(f,p)){g?g=!1:m+=",";const d=JSON.stringify(f);m+=`${d}:`,m+=n(p)}}return m+="}",m}function c(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function Wn(t){return ae(t)&&!Kt(t)?BigInt(t):parseFloat(t)}class Jn{constructor(){ue(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 qe.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)=>er(o)],transformResponse:[o=>Sn(o,void 0,Wn)]})).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 l=0;l<o;l++)c=this.decode_openc3_type(i[l][1]),c!==null&&(i[l][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 l=c[0].length,u=null;for(let h=0;h<l;h++)u=this.decode_openc3_type(c[0][h]),u!==null&&(c[0][h]=u)}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,o={}){let c=null;for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(c=this.encode_openc3_type(n[l]),c!==null&&(n[l]=c));return this.exec(e,[r,s,n],o,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={},i={}){return r===void 0?this.exec("cmd",e,{},n):this._cmd("cmd",e,r,s,n,i)}cmd_no_range_check(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_no_range_check",e,{},n,i):this._cmd("cmd_no_range_check",e,r,s,n,i)}cmd_raw(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_raw",e,{},n,i):this._cmd("cmd_raw",e,r,s,n,i)}cmd_raw_no_range_check(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_raw_no_range_check",e,{},n,i):this._cmd("cmd_raw_no_range_check",e,r,s,n,i)}cmd_no_hazardous_check(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_no_hazardous_check",e,{},n,i):this._cmd("cmd_no_hazardous_check",e,r,s,n,i)}cmd_no_checks(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_no_checks",e,{},n,i):this._cmd("cmd_no_checks",e,r,s,n,i)}cmd_raw_no_hazardous_check(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},n,i):this._cmd("cmd_raw_no_hazardous_check",e,r,s,n,i)}cmd_raw_no_checks(e,r,s,n={},i={}){return r===void 0?this.exec("cmd_raw_no_checks",e,{},n,i):this._cmd("cmd_raw_no_checks",e,r,s,n,i)}build_cmd(e,r,s,n={},i={}){return r===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,r,s,n,i)}build_command(e,r,s,n={},i={}){return r===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,r,s,n,i)}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("")}}}Ae("g",Jn)})}}));
|